forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf4c00d1
committed
When removing a left join, clean out references in EquivalenceClasses.
Since commitb448f1c, we've been able to remove left joins(that are otherwise removable) even when they are underneathother left joins, a case that was previously prevented by adelay_upper_joins check. This is a clear improvement, butit has a surprising side-effect: it's now possible that thereare EquivalenceClasses whose relid sets mention the removedbaserel and/or outer join. If we fail to clean those up,we may drop essential join quals due to not having any joinlevel that appears to satisfy their relid sets.(It's not quite 100% clear that this was impossible before.But the lack of complaints since we added join removal a dozenyears ago strongly suggests that it was impossible.)Richard Guo and Tom Lane, per bug #17976 from Zuming JiangDiscussion:https://postgr.es/m/17976-4b638b525e9a983b@postgresql.org1 parent5c8c807 commitf4c00d1
File tree
3 files changed
+122
-0
lines changed- src
- backend/optimizer/plan
- test/regress
- expected
- sql
3 files changed
+122
-0
lines changedLines changed: 68 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
| 42 | + | |
| 43 | + | |
42 | 44 |
| |
43 | 45 |
| |
44 | 46 |
| |
| |||
511 | 513 |
| |
512 | 514 |
| |
513 | 515 |
| |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
514 | 528 |
| |
515 | 529 |
| |
516 | 530 |
| |
| |||
583 | 597 |
| |
584 | 598 |
| |
585 | 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 | + | |
586 | 654 |
| |
587 | 655 |
| |
588 | 656 |
| |
|
Lines changed: 31 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5881 | 5881 |
| |
5882 | 5882 |
| |
5883 | 5883 |
| |
| 5884 | + | |
| 5885 | + | |
| 5886 | + | |
| 5887 | + | |
| 5888 | + | |
| 5889 | + | |
| 5890 | + | |
| 5891 | + | |
| 5892 | + | |
| 5893 | + | |
| 5894 | + | |
| 5895 | + | |
| 5896 | + | |
| 5897 | + | |
| 5898 | + | |
| 5899 | + | |
| 5900 | + | |
| 5901 | + | |
| 5902 | + | |
| 5903 | + | |
| 5904 | + | |
| 5905 | + | |
| 5906 | + | |
| 5907 | + | |
| 5908 | + | |
| 5909 | + | |
| 5910 | + | |
| 5911 | + | |
| 5912 | + | |
| 5913 | + | |
| 5914 | + | |
5884 | 5915 |
| |
5885 | 5916 |
| |
5886 | 5917 |
| |
|
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2167 | 2167 |
| |
2168 | 2168 |
| |
2169 | 2169 |
| |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
2170 | 2193 |
| |
2171 | 2194 |
| |
2172 | 2195 |
| |
|
0 commit comments
Comments
(0)