postgresql/src/backend
Tom Lane ff720a597c Fix planner to consider matches to boolean columns in extension indexes.
The planner has to special-case indexes on boolean columns, because
what we need for an indexscan on such a column is a qual of the shape
of "boolvar = pseudoconstant".  For plain bool constants, previous
simplification will have reduced this to "boolvar" or "NOT boolvar",
and we have to reverse that if we want to make an indexqual.  There is
existing code to do so, but it only fires when the index's opfamily
is BOOL_BTREE_FAM_OID or BOOL_HASH_FAM_OID.  Thus extension AMs, or
extension opclasses such as contrib/btree_gin, are out in the cold.

The reason for hard-wiring the set of relevant opfamilies was mostly
to avoid a catalog lookup in a hot code path.  We can improve matters
while not taking much of a performance hit by relying on the
hard-wired set when the opfamily OID is visibly built-in, and only
checking the catalogs when dealing with an extension opfamily.

While here, rename IsBooleanOpfamily to IsBuiltinBooleanOpfamily
to remind future users of that macro of its limitations.  At some
point we might want to make indxpath.c's improved version of the
test globally accessible, but it's not presently needed elsewhere.

Zongliang Quan and Tom Lane

Discussion: https://postgr.es/m/f293b91d-1d46-d386-b6bb-4b06ff5c667b@yeah.net
2022-09-02 17:01:51 -04:00
..
access Expand the use of get_dirent_type(), shaving a few calls to stat()/lstat() 2022-09-02 16:58:06 +09:00
backup Remove obsolete comment 2022-08-26 10:44:50 +02:00
bootstrap Process session_preload_libraries within InitPostgres's transaction. 2022-07-25 10:27:43 -04:00
catalog Revert SQL/JSON features 2022-09-01 17:07:14 -04:00
commands Revert SQL/JSON features 2022-09-01 17:07:14 -04:00
executor Revert SQL/JSON features 2022-09-01 17:07:14 -04:00
foreign Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
jit Revert SQL/JSON features 2022-09-01 17:07:14 -04:00
lib More -Wshadow=compatible-local warning fixes 2022-08-26 02:35:40 +12:00
libpq Remove configure probe for sockaddr_in6 and require AF_INET6. 2022-08-26 10:18:30 +12:00
main Fix outdated --help message for postgres -f 2022-08-15 13:36:36 +09:00
nodes Revert SQL/JSON features 2022-09-01 17:07:14 -04:00
optimizer Fix planner to consider matches to boolean columns in extension indexes. 2022-09-02 17:01:51 -04:00
parser Revert SQL/JSON features 2022-09-01 17:07:14 -04:00
partitioning Fix planner to consider matches to boolean columns in extension indexes. 2022-09-02 17:01:51 -04:00
po NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00
port Cleanup more code and comments related to Windows NT4 (XP days) 2022-08-30 09:52:58 +09:00
postmaster Prevent long-term memory leakage in autovacuum launcher. 2022-08-31 16:23:35 -04:00
regex Defend against stack overrun in a few more places. 2022-08-24 13:02:19 -04:00
replication Expand the use of get_dirent_type(), shaving a few calls to stat()/lstat() 2022-09-02 16:58:06 +09:00
rewrite More -Wshadow=compatible-local warning fixes 2022-08-26 02:35:40 +12:00
snowball In the Snowball dictionary, don't try to stem excessively-long words. 2022-08-31 10:42:05 -04:00
statistics More -Wshadow=compatible-local warning fixes 2022-08-26 02:35:40 +12:00
storage Expand the use of get_dirent_type(), shaving a few calls to stat()/lstat() 2022-09-02 16:58:06 +09:00
tcop Allow grant-level control of role inheritance behavior. 2022-08-25 10:06:02 -04:00
tsearch Defend against stack overrun in a few more places. 2022-08-24 13:02:19 -04:00
utils Expand the use of get_dirent_type(), shaving a few calls to stat()/lstat() 2022-09-02 16:58:06 +09:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Remove rule to generate postgres.o, not needed for 20+ years 2022-08-24 20:37:54 -07:00
common.mk Remove SUBSYS.o rule in common.mk, hasn't been used in a long time 2022-08-24 20:38:14 -07:00
nls.mk NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00