forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7122f9d
committed
Fix bit-rotted planner test case.
While fooling with my pet outer-join-variables patch, I discoveredthat the test case I added in commit11086f2 no longer demonstrateswhat it's supposed to. The idea is to tempt the planner to reversethe order of the two outer joins, which would leave noplace tocorrectly evaluate the WHERE clause that's inserted between them.Before the addition of the delay_upper_joins mechanism, it wouldhave taken the bait.However, subsequent improvements broke the test in two different ways.First, we now recognize the IS NULL coding pattern as an antijoin, andwe won't re-order antijoins; even if we did, the IS NULL test clausesget removed so there would be no opportunity for them to misbehave.Second, the planner now discovers that nested parameterized indexscansare a lot cheaper than the double hash join it used back in the day,and that approach doesn't want to re-order the joins anyway. Thus,in HEAD the test passes even if one dikes out delay_upper_joins.To fix, change the IS NULL tests to COALESCE clauses, which producethe same results but the planner isn't smart enough to convert themto antijoins. It'll still go for parameterized indexscans though,so drop the index enabling that (don't know why I added that in thefirst place), and disable nestloop joining just to be sure.This time around, add an EXPLAIN to make the choice of plan visible.1 parent0efecb5 commit7122f9d
2 files changed
+50
-6
lines changedLines changed: 32 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2630 | 2630 |
| |
2631 | 2631 |
| |
2632 | 2632 |
| |
2633 |
| - | |
2634 | 2633 |
| |
2635 | 2634 |
| |
2636 | 2635 |
| |
2637 | 2636 |
| |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
2638 | 2665 |
| |
2639 | 2666 |
| |
2640 | 2667 |
| |
2641 | 2668 |
| |
2642 | 2669 |
| |
2643 |
| - | |
| 2670 | + | |
2644 | 2671 |
| |
2645 |
| - | |
| 2672 | + | |
| 2673 | + | |
2646 | 2674 |
| |
2647 | 2675 |
| |
2648 | 2676 |
| |
2649 | 2677 |
| |
2650 | 2678 |
| |
2651 | 2679 |
| |
2652 | 2680 |
| |
| 2681 | + | |
2653 | 2682 |
| |
2654 | 2683 |
| |
2655 | 2684 |
| |
|
Lines changed: 18 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
608 | 608 |
| |
609 | 609 |
| |
610 | 610 |
| |
611 |
| - | |
612 | 611 |
| |
613 | 612 |
| |
614 | 613 |
| |
615 | 614 |
| |
616 | 615 |
| |
617 | 616 |
| |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
618 | 630 |
| |
619 | 631 |
| |
620 | 632 |
| |
621 | 633 |
| |
622 | 634 |
| |
623 |
| - | |
| 635 | + | |
624 | 636 |
| |
625 |
| - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
626 | 641 |
| |
627 | 642 |
| |
628 | 643 |
| |
|
0 commit comments
Comments
(0)