-
- Downloads
Fix matching of boolean index columns to sort ordering.
Normally, if we have a WHERE clause like "indexcol = constant", the planner will figure out that that index column can be ignored when determining whether the index has a desired sort ordering. But this failed to work for boolean index columns, because a condition like "boolcol = true" is canonicalized to just "boolcol" which does not give rise to an EquivalenceClass. Add a check to allow the same type of deduction to be made in this case too. Per a complaint from Dima Pavlov. Arguably this is a bug, but given the limited impact and the small number of complaints so far, I won't risk destabilizing plans in stable branches by back-patching. Patch by me, reviewed by Michael Paquier Discussion: https://postgr.es/m/1788.1481605684@sss.pgh.pa.us
Showing
- src/backend/optimizer/path/indxpath.c 46 additions, 0 deletionssrc/backend/optimizer/path/indxpath.c
- src/backend/optimizer/path/pathkeys.c 24 additions, 11 deletionssrc/backend/optimizer/path/pathkeys.c
- src/include/optimizer/paths.h 2 additions, 0 deletionssrc/include/optimizer/paths.h
- src/test/regress/expected/create_index.out 42 additions, 0 deletionssrc/test/regress/expected/create_index.out
- src/test/regress/sql/create_index.sql 15 additions, 0 deletionssrc/test/regress/sql/create_index.sql
Loading
Please register or sign in to comment