]> granicus.if.org Git - postgresql/commit
Expand the 'special index operator' machinery to handle special cases
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 26 Mar 2005 23:29:20 +0000 (23:29 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 26 Mar 2005 23:29:20 +0000 (23:29 +0000)
commitfebc9a613cd523de84da883a81e2040c3b1336a6
tree8f464a85bbe6d8983bcfea7ba0210e0b89c79b07
parent9d388e1f3980a9d960c2f7c500f9c13a35c48d88
Expand the 'special index operator' machinery to handle special cases
for boolean indexes.  Previously we would only use such an index with
WHERE clauses like 'indexkey = true' or 'indexkey = false'.  The new
code transforms the cases 'indexkey', 'NOT indexkey', 'indexkey IS TRUE',
and 'indexkey IS FALSE' into one of these.  While this is only marginally
useful in itself, I intend soon to change constant-expression simplification
so that 'foo = true' and 'foo = false' are reduced to just 'foo' and
'NOT foo' ... which would lose the ability to use boolean indexes for
such queries at all, if the indexscan machinery couldn't make the
reverse transformation.
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/path/orindxpath.c
src/backend/optimizer/util/pathnode.c
src/include/catalog/pg_opclass.h
src/include/optimizer/paths.h