forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6bdc300
committed
Fix indexable-row-comparison logic to account for covering indexes.
indxpath.c needs a good deal more attention for covering indexes thanit's gotten. But so far as I can tell, the only really awful breakageis in expand_indexqual_rowcompare (nee adjust_rowcompare_for_index),which was only half fixed inc266ed3. The other problems aren'tbad enough to take the risk of a just-before-wrap fix.The problem here is that if the leading column of a row comparisonmatches an index (allowing this code to be reached), and some latercolumn doesn't match the index, it'll nonetheless believe that thatcolumn matches the first included index column. Typically that'lllead to an error like "operator M is not a member of opfamily N" asa result of fetching a garbage opfamily OID. But with enough badluck, maybe a broken plan would be generated.Discussion:https://postgr.es/m/25526.1549847928@sss.pgh.pa.us1 parent72d71e0 commit6bdc300
File tree
3 files changed
+22
-2
lines changed- src
- backend/optimizer/path
- test/regress
- expected
- sql
3 files changed
+22
-2
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3979 | 3979 |
| |
3980 | 3980 |
| |
3981 | 3981 |
| |
3982 |
| - | |
| 3982 | + | |
3983 | 3983 |
| |
3984 | 3984 |
| |
3985 | 3985 |
| |
| |||
3991 | 3991 |
| |
3992 | 3992 |
| |
3993 | 3993 |
| |
3994 |
| - | |
| 3994 | + | |
3995 | 3995 |
| |
3996 | 3996 |
| |
3997 | 3997 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
127 | 127 |
| |
128 | 128 |
| |
129 | 129 |
| |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
130 | 147 |
| |
131 | 148 |
| |
132 | 149 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 |
| |
77 | 80 |
| |
78 | 81 |
| |
|
0 commit comments
Comments
(0)