pgsql: Support "x IS NOT NULL" clauses as indexscan conditions.

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Support "x IS NOT NULL" clauses as indexscan conditions.
Date: 2010-01-01 21:53:49
Message-ID: 20100101215349.F2DC1753FB7@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Support "x IS NOT NULL" clauses as indexscan conditions. This turns out
to be just a minor extension of the previous patch that made "x IS NULL"
indexable, because we can treat the IS NOT NULL condition as if it were
"x < NULL" or "x > NULL" (depending on the index's NULLS FIRST/LAST option),
just like IS NULL is treated like "x = NULL". Aside from any possible
usefulness in its own right, this is an important improvement for
index-optimized MAX/MIN aggregates: it is now reliably possible to get
a column's min or max value cheaply, even when there are a lot of nulls
cluttering the interesting end of the index.

Modified Files:
--------------
pgsql/doc/src/sgml:
catalogs.sgml (r2.215 -> r2.216)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/catalogs.sgml?r1=2.215&r2=2.216)
indexam.sgml (r2.31 -> r2.32)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/indexam.sgml?r1=2.31&r2=2.32)
indices.sgml (r1.79 -> r1.80)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/indices.sgml?r1=1.79&r2=1.80)
pgsql/src/backend/access/common:
scankey.c (r1.32 -> r1.33)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/common/scankey.c?r1=1.32&r2=1.33)
pgsql/src/backend/access/gist:
gistget.c (r1.82 -> r1.83)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/gist/gistget.c?r1=1.82&r2=1.83)
gistscan.c (r1.76 -> r1.77)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/gist/gistscan.c?r1=1.76&r2=1.77)
pgsql/src/backend/access/nbtree:
nbtutils.c (r1.94 -> r1.95)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/nbtree/nbtutils.c?r1=1.94&r2=1.95)
pgsql/src/backend/executor:
nodeIndexscan.c (r1.136 -> r1.137)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeIndexscan.c?r1=1.136&r2=1.137)
pgsql/src/backend/optimizer/path:
indxpath.c (r1.242 -> r1.243)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/indxpath.c?r1=1.242&r2=1.243)
pgsql/src/backend/optimizer/plan:
createplan.c (r1.268 -> r1.269)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/createplan.c?r1=1.268&r2=1.269)
planagg.c (r1.47 -> r1.48)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planagg.c?r1=1.47&r2=1.48)
pgsql/src/backend/utils/adt:
selfuncs.c (r1.264 -> r1.265)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/selfuncs.c?r1=1.264&r2=1.265)
pgsql/src/include/access:
skey.h (r1.37 -> r1.38)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/skey.h?r1=1.37&r2=1.38)
pgsql/src/include/catalog:
pg_am.h (r1.62 -> r1.63)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_am.h?r1=1.62&r2=1.63)
pgsql/src/include/nodes:
relation.h (r1.180 -> r1.181)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/relation.h?r1=1.180&r2=1.181)
pgsql/src/include/optimizer:
planmain.h (r1.121 -> r1.122)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/planmain.h?r1=1.121&r2=1.122)
pgsql/src/test/regress/expected:
create_index.out (r1.34 -> r1.35)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/create_index.out?r1=1.34&r2=1.35)
pgsql/src/test/regress/sql:
create_index.sql (r1.28 -> r1.29)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/create_index.sql?r1=1.28&r2=1.29)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-01-01 23:03:10 pgsql: Add an "argisrow" field to NullTest nodes, following a plan made
Previous Message Magnus Hagander 2010-01-01 19:57:08 pgsql: Silence compiler warning on 64-bit windows build