From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Support min/max index optimizations on boolean columns. |
Date: | 2012-02-08 17:41:58 |
Message-ID: | E1RvBWo-0005qZ-7O@gemulon.postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/cbba55d6d792b55f6b448a31fc14aef84510967c
Modified Files
--------------
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_aggregate.h | 6 +++---
src/test/regress/expected/opr_sanity.out | 30 ++++++++++++++++++------------
src/test/regress/sql/opr_sanity.sql | 4 ++--
4 files changed, 24 insertions(+), 18 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2012-02-08 18:15:18 | pgsql: Check misplaced window functions before checking aggregate/group |
Previous Message | Tom Lane | 2012-02-08 16:29:43 | pgsql: Mark some more I/O-conversion-invoking functions as stable not v |