Thread: pgsql: Expand the 'special index operator' machinery to handle special

pgsql: Expand the 'special index operator' machinery to handle special

From
tgl@svr1.postgresql.org (Tom Lane)
Date:
Log Message:
-----------
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.

Modified Files:
--------------
    pgsql/src/backend/optimizer/path:
        indxpath.c (r1.169 -> r1.170)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/indxpath.c.diff?r1=1.169&r2=1.170)
        orindxpath.c (r1.65 -> r1.66)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/orindxpath.c.diff?r1=1.65&r2=1.66)
    pgsql/src/backend/optimizer/util:
        pathnode.c (r1.112 -> r1.113)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/pathnode.c.diff?r1=1.112&r2=1.113)
    pgsql/src/include/catalog:
        pg_opclass.h (r1.62 -> r1.63)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_opclass.h.diff?r1=1.62&r2=1.63)
    pgsql/src/include/optimizer:
        paths.h (r1.78 -> r1.79)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/paths.h.diff?r1=1.78&r2=1.79)