Support "x IS NOT NULL" clauses as indexscan conditions. This turns out

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 29c4ad98293e3c5cb3fcdd413a3f4904efff8762
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-01-01T21:53:49Z
Releases: 9.0.0
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.

Files