forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6b652e6
committed
Set query ID for inner queries of CREATE TABLE AS and DECLARE
Some utility statements contain queries that can be planned andexecuted: CREATE TABLE AS and DECLARE CURSOR. This commit adds query IDcomputation for the inner queries executed by these two utilitycommands, with and without EXPLAIN. This change leads to four newcallers of JumbleQuery() and post_parse_analyze_hook() so as extensionscan decide what to do with this new data.Previously, extensions relying on the query ID, like pg_stat_statements,were not able to track these nested queries as the query_id was 0.For pg_stat_statements, this commit leads to additions under !toplevelwhen pg_stat_statements.track is set to "all", as shown in itsregression tests. The output of EXPLAIN for these two utilities gains a"Query Identifier" if compute_query_id is enabled.Author: Anthonin BonnefoyReviewed-by: Michael Paquier, Jian HeDiscussion:https://postgr.es/m/CAO6_XqqM6S9bQ2qd=75W+yKATwoazxSNhv5sjW06fjGAtHbTUA@mail.gmail.com1 parent33b2fbe commit6b652e6
File tree
9 files changed
+89
-35
lines changed- contrib/pg_stat_statements/expected
- src
- backend/commands
- include/commands
- test/regress
- expected
- sql
9 files changed
+89
-35
lines changedLines changed: 8 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
924 | 924 |
| |
925 | 925 |
| |
926 | 926 |
| |
| 927 | + | |
927 | 928 |
| |
928 |
| - | |
| 929 | + | |
929 | 930 |
| |
930 | 931 |
| |
931 | 932 |
| |
| |||
1047 | 1048 |
| |
1048 | 1049 |
| |
1049 | 1050 |
| |
| 1051 | + | |
1050 | 1052 |
| |
1051 | 1053 |
| |
1052 |
| - | |
| 1054 | + | |
1053 | 1055 |
| |
1054 | 1056 |
| |
1055 | 1057 |
| |
| |||
1089 | 1091 |
| |
1090 | 1092 |
| |
1091 | 1093 |
| |
| 1094 | + | |
1092 | 1095 |
| |
1093 |
| - | |
| 1096 | + | |
1094 | 1097 |
| |
1095 | 1098 |
| |
1096 | 1099 |
| |
| |||
1140 | 1143 |
| |
1141 | 1144 |
| |
1142 | 1145 |
| |
| 1146 | + | |
1143 | 1147 |
| |
1144 |
| - | |
| 1148 | + | |
1145 | 1149 |
| |
1146 | 1150 |
| |
1147 | 1151 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| 40 | + | |
| 41 | + | |
40 | 42 |
| |
41 | 43 |
| |
42 | 44 |
| |
| |||
222 | 224 |
| |
223 | 225 |
| |
224 | 226 |
| |
| 227 | + | |
225 | 228 |
| |
226 | 229 |
| |
227 | 230 |
| |
| |||
236 | 239 |
| |
237 | 240 |
| |
238 | 241 |
| |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
239 | 249 |
| |
240 | 250 |
| |
241 | 251 |
| |
|
Lines changed: 27 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
74 |
| - | |
75 |
| - | |
| 74 | + | |
76 | 75 |
| |
77 | 76 |
| |
78 | 77 |
| |
| |||
350 | 349 |
| |
351 | 350 |
| |
352 | 351 |
| |
353 |
| - | |
| 352 | + | |
354 | 353 |
| |
355 | 354 |
| |
356 | 355 |
| |
| |||
436 | 435 |
| |
437 | 436 |
| |
438 | 437 |
| |
439 |
| - | |
440 |
| - | |
| 438 | + | |
441 | 439 |
| |
442 | 440 |
| |
443 | 441 |
| |
444 | 442 |
| |
445 |
| - | |
446 |
| - | |
| 443 | + | |
447 | 444 |
| |
448 | 445 |
| |
449 | 446 |
| |
450 | 447 |
| |
451 | 448 |
| |
452 | 449 |
| |
453 |
| - | |
| 450 | + | |
454 | 451 |
| |
455 | 452 |
| |
456 |
| - | |
| 453 | + | |
457 | 454 |
| |
458 | 455 |
| |
459 | 456 |
| |
| |||
534 | 531 |
| |
535 | 532 |
| |
536 | 533 |
| |
537 |
| - | |
538 |
| - | |
| 534 | + | |
539 | 535 |
| |
540 | 536 |
| |
541 | 537 |
| |
| |||
547 | 543 |
| |
548 | 544 |
| |
549 | 545 |
| |
| 546 | + | |
550 | 547 |
| |
| 548 | + | |
551 | 549 |
| |
552 | 550 |
| |
553 | 551 |
| |
| |||
565 | 563 |
| |
566 | 564 |
| |
567 | 565 |
| |
568 |
| - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
569 | 572 |
| |
570 | 573 |
| |
571 | 574 |
| |
572 |
| - | |
| 575 | + | |
573 | 576 |
| |
574 | 577 |
| |
575 | 578 |
| |
| |||
582 | 585 |
| |
583 | 586 |
| |
584 | 587 |
| |
| 588 | + | |
585 | 589 |
| |
| 590 | + | |
586 | 591 |
| |
587 |
| - | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
588 | 599 |
| |
589 | 600 |
| |
590 | 601 |
| |
591 |
| - | |
| 602 | + | |
592 | 603 |
| |
593 | 604 |
| |
594 | 605 |
| |
595 |
| - | |
| 606 | + | |
596 | 607 |
| |
597 | 608 |
| |
598 | 609 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| 31 | + | |
| 32 | + | |
31 | 33 |
| |
32 | 34 |
| |
33 | 35 |
| |
| |||
44 | 46 |
| |
45 | 47 |
| |
46 | 48 |
| |
| 49 | + | |
47 | 50 |
| |
48 | 51 |
| |
49 | 52 |
| |
| |||
71 | 74 |
| |
72 | 75 |
| |
73 | 76 |
| |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
74 | 84 |
| |
75 | 85 |
| |
76 | 86 |
| |
|
Lines changed: 9 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
561 | 561 |
| |
562 | 562 |
| |
563 | 563 |
| |
564 |
| - | |
| 564 | + | |
565 | 565 |
| |
566 | 566 |
| |
567 | 567 |
| |
568 | 568 |
| |
569 |
| - | |
570 |
| - | |
| 569 | + | |
571 | 570 |
| |
572 | 571 |
| |
573 | 572 |
| |
| |||
610 | 609 |
| |
611 | 610 |
| |
612 | 611 |
| |
613 |
| - | |
| 612 | + | |
614 | 613 |
| |
615 |
| - | |
616 |
| - | |
| 614 | + | |
| 615 | + | |
617 | 616 |
| |
618 | 617 |
| |
619 | 618 |
| |
| |||
624 | 623 |
| |
625 | 624 |
| |
626 | 625 |
| |
627 |
| - | |
| 626 | + | |
628 | 627 |
| |
629 | 628 |
| |
630 | 629 |
| |
631 | 630 |
| |
632 |
| - | |
| 631 | + | |
633 | 632 |
| |
634 | 633 |
| |
635 | 634 |
| |
| |||
655 | 654 |
| |
656 | 655 |
| |
657 | 656 |
| |
658 |
| - | |
| 657 | + | |
659 | 658 |
| |
660 | 659 |
| |
661 | 660 |
| |
662 |
| - | |
663 |
| - | |
| 661 | + | |
664 | 662 |
| |
665 | 663 |
| |
666 | 664 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
100 | 100 |
| |
101 | 101 |
| |
102 | 102 |
| |
103 |
| - | |
104 |
| - | |
| 103 | + | |
| 104 | + | |
105 | 105 |
| |
106 | 106 |
| |
107 | 107 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
46 |
| - | |
47 |
| - | |
| 46 | + | |
| 47 | + | |
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
662 | 662 |
| |
663 | 663 |
| |
664 | 664 |
| |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
665 | 682 |
| |
666 | 683 |
| |
667 | 684 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
163 | 163 |
| |
164 | 164 |
| |
165 | 165 |
| |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
166 | 170 |
| |
167 | 171 |
| |
168 | 172 |
| |
|
0 commit comments
Comments
(0)