- Notifications
You must be signed in to change notification settings - Fork5
Commite2c2c2e
committed
Improve planner's handling of duplicated index column expressions.
It's potentially useful for an index to repeat the same indexable columnor expression in multiple index columns, if the columns have differentopclasses. (If they share opclasses too, the duplicate column is prettyuseless, but nonetheless we've allowed such cases since 9.0.) However,the planner failed to cope with this, because createplan.c was relying onsimple equal() matching to figure out which index column each index qualis intended for. We do have that information available upstream inindxpath.c, though, so the fix is to not flatten the multi-level indexqualslist when putting it into an IndexPath. Then we can rely on the subliststructure to identify target index columns in createplan.c. There's asimilar issue for index ORDER BYs (the KNNGIST feature), so introduce amulti-level-list representation for that too. This adds a bit morerepresentational overhead, but we might more or less buy that back by nothaving to search for matching index columns anymore in createplan.c;likewise btcostestimate saves some cycles.Per bug #6351 from Christian Rudolph. Likely symptoms include the "btreeindex keys must be ordered by attribute" failure shown there, as well as"operator MMMM is not a member of opfamily NNNN".Although this is a pre-existing problem that can be demonstrated in 9.0 and9.1, I'm not going to back-patch it, because the API changes in the plannerseem likely to break things such as index plugins. The corner cases wherethis matters seem too narrow to justify possibly breaking things in a minorrelease.1 parentd5448c7 commite2c2c2e
File tree
12 files changed
+560
-317
lines changed- src
- backend
- optimizer
- path
- plan
- util
- utils/adt
- include
- nodes
- optimizer
- test/regress
- expected
- output
- sql
12 files changed
+560
-317
lines changedLines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
209 | 209 |
| |
210 | 210 |
| |
211 | 211 |
| |
212 |
| - | |
213 |
| - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
214 | 216 |
| |
215 | 217 |
| |
216 | 218 |
| |
| |||
221 | 223 |
| |
222 | 224 |
| |
223 | 225 |
| |
224 |
| - | |
225 |
| - | |
| 226 | + | |
| 227 | + | |
226 | 228 |
| |
227 | 229 |
| |
228 | 230 |
| |
|
0 commit comments
Comments
(0)