- Notifications
You must be signed in to change notification settings - Fork5
Commit44634e4
committed
Allow child-relation entries to be made in ec_has_const EquivalenceClasses.
This fixes an oversight in commit11cad29,which introduced MergeAppend plans. Before that happened, we neverparticularly cared about the sort ordering of scans of inheritance childrelations, since appending their outputs together would destroy anyordering anyway. But now it's important to be able to match child relationsort orderings to those of the surrounding query. The original coding ofadd_child_rel_equivalences skipped ec_has_const EquivalenceClasses, on theoriginally-correct grounds that adding child expressions to them wasuseless. The effect of this is that when a parent variable is equated toa constant, we can't recognize that index columns on the equivalent childvariables are not sort-significant; that is, we can't recognize that achild index on, say, (x, y) is able to generate output in "ORDER BY y"order when there is a clause "WHERE x = constant". Adding childexpressions to the (x, constant) EquivalenceClass fixes this, without anydownside that I can see other than a few more planner cycles expended onsuch queries.Per recent gripe from Robert McGehee. Back-patch to 9.1 where MergeAppendwas introduced.1 parent6688d28 commit44634e4
1 file changed
+3
-6
lines changedLines changed: 3 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1785 | 1785 |
| |
1786 | 1786 |
| |
1787 | 1787 |
| |
1788 |
| - | |
1789 |
| - | |
1790 |
| - | |
1791 | 1788 |
| |
1792 |
| - | |
1793 |
| - | |
| 1789 | + | |
| 1790 | + | |
1794 | 1791 |
| |
1795 |
| - | |
| 1792 | + | |
1796 | 1793 |
| |
1797 | 1794 |
| |
1798 | 1795 |
| |
|
0 commit comments
Comments
(0)