diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-02-08 12:41:48 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-02-08 12:41:48 -0500 |
commit | cbba55d6d792b55f6b448a31fc14aef84510967c (patch) | |
tree | 79718d5a433fe74e552518a4269f66d6718576d8 /src/include | |
parent | 3db6524fe63f0598dcb2b307bb422bc126f2b15d (diff) | |
download | postgresql-cbba55d6d792b55f6b448a31fc14aef84510967c.tar.gz postgresql-cbba55d6d792b55f6b448a31fc14aef84510967c.zip |
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
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/catversion.h | 2 | ||||
-rw-r--r-- | src/include/catalog/pg_aggregate.h | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index ea941447f54..78c3c9e81c9 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 201202082 +#define CATALOG_VERSION_NO 201202083 #endif diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h index 0c8a20c0056..adda07c6c4b 100644 --- a/src/include/catalog/pg_aggregate.h +++ b/src/include/catalog/pg_aggregate.h @@ -205,9 +205,9 @@ DATA(insert ( 2828 float8_regr_accum float8_covar_samp 0 1022 "{0,0,0,0,0,0}" ) DATA(insert ( 2829 float8_regr_accum float8_corr 0 1022 "{0,0,0,0,0,0}" )); /* boolean-and and boolean-or */ -DATA(insert ( 2517 booland_statefunc - 0 16 _null_ )); -DATA(insert ( 2518 boolor_statefunc - 0 16 _null_ )); -DATA(insert ( 2519 booland_statefunc - 0 16 _null_ )); +DATA(insert ( 2517 booland_statefunc - 58 16 _null_ )); +DATA(insert ( 2518 boolor_statefunc - 59 16 _null_ )); +DATA(insert ( 2519 booland_statefunc - 58 16 _null_ )); /* bitwise integer */ DATA(insert ( 2236 int2and - 0 21 _null_ )); |