postgresql/src/include/optimizer
Tom Lane 0777f7a2e8 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
2017-01-15 14:09:35 -05:00
..
clauses.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
cost.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
geqo.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
geqo_copy.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
geqo_gene.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
geqo_misc.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
geqo_mutation.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
geqo_pool.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
geqo_random.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
geqo_recombination.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
geqo_selection.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
joininfo.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
orclauses.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
pathnode.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
paths.h Fix matching of boolean index columns to sort ordering. 2017-01-15 14:09:35 -05:00
placeholder.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
plancat.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
planmain.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
planner.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
predtest.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
prep.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
restrictinfo.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
subselect.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
tlist.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
var.h Update copyright via script for 2017 2017-01-03 13:48:53 -05:00