Support min/max index optimizations on boolean columns.

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

Commit: cbba55d6d792b55f6b448a31fc14aef84510967c
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2012-02-08T17:41:48Z
Releases: 9.2.0
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

Files