]> granicus.if.org Git - postgresql/commit
Support min/max index optimizations on boolean columns.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 8 Feb 2012 17:41:48 +0000 (12:41 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 8 Feb 2012 17:41:48 +0000 (12:41 -0500)
commitcbba55d6d792b55f6b448a31fc14aef84510967c
tree79718d5a433fe74e552518a4269f66d6718576d8
parent3db6524fe63f0598dcb2b307bb422bc126f2b15d
Support min/max index optimizations on boolean columns.

Since bool_and() is equivalent to min(), and bool_or() to max(), we might
as well let them be index-optimized in the same way.  The practical value
of this is debatable at best, but it seems nearly cost-free to enable it.
Code-wise, we need only adjust the entries in pg_aggregate.  There is a
measurable planning speed penalty for a query involving one of these
aggregates, but it is only a few percent in simple cases, so that seems
acceptable.

Marti Raudsepp, reviewed by Abhijit Menon-Sen
src/include/catalog/catversion.h
src/include/catalog/pg_aggregate.h
src/test/regress/expected/opr_sanity.out
src/test/regress/sql/opr_sanity.sql