- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit5d8aa8b
committed
Fix missed optimization in relation_excluded_by_constraints().
In commit3fc6e2d, I (tgl) argued that we only need to check fora constant-FALSE restriction clause when there's exactly onerestriction clause, on the grounds that const-folding would havethrown away anything ANDed with a Const FALSE. That's true just afterconst-folding has been applied, but subsequent processing such asequivalence class expansion could result in cases where a Const FALSEis ANDed with some other stuff. (Compare for instance joinrels.c'srestriction_is_constant_false.) Hence, tweak this logic to check allthe elements of the baserestrictinfo list, not just one; that's cheapenough to not be worth worrying about.There is one existing test case where this visibly improves the plan.There would not be any savings in runtime, but the planner effort andexecutor startup effort will be reduced, and anyway it's odd thatwe can detect related cases but not this one.Richard Guo (independently discovered by David Rowley)Discussion:https://postgr.es/m/CAMbWs4_x3-CnVVrCboS1LkEhB5V+W7sLSCabsRiG+n7+5_kqbg@mail.gmail.com1 parent16671ba commit5d8aa8b
2 files changed
+12
-13
lines changedLines changed: 9 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1549 | 1549 |
| |
1550 | 1550 |
| |
1551 | 1551 |
| |
1552 |
| - | |
1553 |
| - | |
1554 |
| - | |
1555 |
| - | |
1556 |
| - | |
1557 |
| - | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
1558 | 1559 |
| |
1559 |
| - | |
| 1560 | + | |
1560 | 1561 |
| |
1561 |
| - | |
| 1562 | + | |
1562 | 1563 |
| |
1563 | 1564 |
| |
1564 | 1565 |
| |
|
Lines changed: 3 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5788 | 5788 |
| |
5789 | 5789 |
| |
5790 | 5790 |
| |
5791 |
| - | |
5792 |
| - | |
| 5791 | + | |
| 5792 | + | |
5793 | 5793 |
| |
5794 | 5794 |
| |
5795 |
| - | |
5796 |
| - | |
5797 |
| - | |
| 5795 | + | |
5798 | 5796 |
| |
5799 | 5797 |
| |
5800 | 5798 |
| |
|
0 commit comments
Comments
(0)