forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfd0398f
committed
Improve EXPLAIN's display of SubPlan nodes and output parameters.
Historically we've printed SubPlan expression nodes as "(SubPlan N)",which is pretty uninformative. Trying to reproduce the original SQLfor the subquery is still as impractical as before, and would bemighty verbose as well. However, we can still do better than that.Displaying the "testexpr" when present, and adding a keyword toindicate the SubLinkType, goes a long way toward showing what'sreally going on.In addition, this patch gets rid of EXPLAIN's use of "$n" to representsubplan and initplan output Params. Instead we now print "(SubPlanN).colX" or "(InitPlan N).colX" to represent the X'th output columnof that subplan. This eliminates confusion with the use of "$n" torepresent PARAM_EXTERN Params, and it's useful for the first part ofthis change because it eliminates needing some other indication ofwhich subplan is referenced by a SubPlan that has a testexpr.In passing, this adds simple regression test coverage of theROWCOMPARE_SUBLINK code paths, which were entirely unburdenedby testing before.Tom Lane and Dean Rasheed, reviewed by Aleksander Alekseev.Thanks to Chantal Keller for raising the question of whetherthis area couldn't be improved.Discussion:https://postgr.es/m/2838538.1705692747@sss.pgh.pa.us1 parentcc4826d commitfd0398f
File tree
24 files changed
+793
-464
lines changed- contrib/postgres_fdw/expected
- doc/src/sgml
- src
- backend
- commands
- optimizer/plan
- utils/adt
- test/regress
- expected
- sql
24 files changed
+793
-464
lines changedLines changed: 17 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3062 | 3062 |
| |
3063 | 3063 |
| |
3064 | 3064 |
| |
3065 |
| - | |
| 3065 | + | |
3066 | 3066 |
| |
3067 | 3067 |
| |
3068 |
| - | |
| 3068 | + | |
3069 | 3069 |
| |
3070 | 3070 |
| |
3071 | 3071 |
| |
| |||
3080 | 3080 |
| |
3081 | 3081 |
| |
3082 | 3082 |
| |
3083 |
| - | |
3084 |
| - | |
| 3083 | + | |
| 3084 | + | |
3085 | 3085 |
| |
3086 | 3086 |
| |
3087 | 3087 |
| |
| |||
3305 | 3305 |
| |
3306 | 3306 |
| |
3307 | 3307 |
| |
3308 |
| - | |
3309 |
| - | |
| 3308 | + | |
| 3309 | + | |
3310 | 3310 |
| |
3311 |
| - | |
| 3311 | + | |
3312 | 3312 |
| |
3313 | 3313 |
| |
3314 | 3314 |
| |
| |||
6171 | 6171 |
| |
6172 | 6172 |
| |
6173 | 6173 |
| |
6174 |
| - | |
| 6174 | + | |
6175 | 6175 |
| |
6176 |
| - | |
| 6176 | + | |
6177 | 6177 |
| |
6178 | 6178 |
| |
6179 | 6179 |
| |
| |||
11685 | 11685 |
| |
11686 | 11686 |
| |
11687 | 11687 |
| |
11688 |
| - | |
| 11688 | + | |
11689 | 11689 |
| |
11690 |
| - | |
| 11690 | + | |
11691 | 11691 |
| |
11692 | 11692 |
| |
11693 | 11693 |
| |
| |||
11699 | 11699 |
| |
11700 | 11700 |
| |
11701 | 11701 |
| |
11702 |
| - | |
| 11702 | + | |
11703 | 11703 |
| |
11704 | 11704 |
| |
11705 |
| - | |
| 11705 | + | |
11706 | 11706 |
| |
11707 | 11707 |
| |
11708 | 11708 |
| |
| |||
11713 | 11713 |
| |
11714 | 11714 |
| |
11715 | 11715 |
| |
11716 |
| - | |
| 11716 | + | |
11717 | 11717 |
| |
11718 | 11718 |
| |
11719 | 11719 |
| |
| |||
11936 | 11936 |
| |
11937 | 11937 |
| |
11938 | 11938 |
| |
11939 |
| - | |
11940 |
| - | |
| 11939 | + | |
| 11940 | + | |
11941 | 11941 |
| |
11942 | 11942 |
| |
11943 |
| - | |
| 11943 | + | |
11944 | 11944 |
| |
11945 | 11945 |
| |
11946 | 11946 |
| |
|
Lines changed: 100 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
573 | 573 |
| |
574 | 574 |
| |
575 | 575 |
| |
576 |
| - | |
577 |
| - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
578 | 676 |
| |
579 | 677 |
| |
580 | 678 |
| |
|
Lines changed: 0 additions & 32 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
116 | 116 |
| |
117 | 117 |
| |
118 | 118 |
| |
119 |
| - | |
120 | 119 |
| |
121 | 120 |
| |
122 | 121 |
| |
| |||
1914 | 1913 |
| |
1915 | 1914 |
| |
1916 | 1915 |
| |
1917 |
| - | |
1918 |
| - | |
1919 |
| - | |
1920 |
| - | |
1921 | 1916 |
| |
1922 | 1917 |
| |
1923 | 1918 |
| |
| |||
1942 | 1937 |
| |
1943 | 1938 |
| |
1944 | 1939 |
| |
1945 |
| - | |
1946 |
| - | |
1947 |
| - | |
1948 |
| - | |
1949 | 1940 |
| |
1950 | 1941 |
| |
1951 | 1942 |
| |
| |||
3550 | 3541 |
| |
3551 | 3542 |
| |
3552 | 3543 |
| |
3553 |
| - | |
3554 |
| - | |
3555 |
| - | |
3556 |
| - | |
3557 |
| - | |
3558 |
| - | |
3559 |
| - | |
3560 |
| - | |
3561 |
| - | |
3562 |
| - | |
3563 |
| - | |
3564 |
| - | |
3565 |
| - | |
3566 |
| - | |
3567 |
| - | |
3568 |
| - | |
3569 |
| - | |
3570 |
| - | |
3571 |
| - | |
3572 |
| - | |
3573 |
| - | |
3574 |
| - | |
3575 |
| - | |
3576 | 3544 |
| |
3577 | 3545 |
| |
3578 | 3546 |
| |
|
Lines changed: 4 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
560 | 560 |
| |
561 | 561 |
| |
562 | 562 |
| |
563 |
| - | |
564 |
| - | |
565 |
| - | |
566 |
| - | |
567 |
| - | |
568 |
| - | |
569 |
| - | |
570 |
| - | |
571 |
| - | |
572 |
| - | |
573 |
| - | |
574 |
| - | |
575 |
| - | |
576 |
| - | |
577 |
| - | |
578 |
| - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
579 | 566 |
| |
580 | 567 |
| |
581 | 568 |
| |
| |||
3047 | 3034 |
| |
3048 | 3035 |
| |
3049 | 3036 |
| |
3050 |
| - | |
3051 |
| - | |
| 3037 | + | |
3052 | 3038 |
| |
3053 | 3039 |
| |
3054 | 3040 |
| |
|
0 commit comments
Comments
(0)