postgresql/src
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
..
backend Fix planner to consider matches to boolean columns in extension indexes. 2022-09-02 17:01:51 -04:00
bin Refactor check_ functions to use filehandle for status 2022-08-31 13:06:50 +02:00
common Speed up lexing of long JSON strings 2022-09-02 09:36:22 +07:00
fe_utils Clean up inconsistent use of fflush(). 2022-08-29 13:55:41 -04:00
include Fix planner to consider matches to boolean columns in extension indexes. 2022-09-02 17:01:51 -04:00
interfaces Revert SQL/JSON features 2022-09-01 17:07:14 -04:00
makefiles aix: when building with gcc, tell gcc we're building a shared library 2022-09-01 11:49:36 -07:00
pl Fix PL/Perl build on Cygwin 2022-09-02 17:56:14 +02:00
port Cleanup more code and comments related to Windows NT4 (XP days) 2022-08-30 09:52:58 +09:00
template Move darwin sysroot determination into separate file 2022-09-01 16:54:19 -07:00
test Speed up lexing of long JSON strings 2022-09-02 09:36:22 +07:00
timezone Expand the use of get_dirent_type(), shaving a few calls to stat()/lstat() 2022-09-02 16:58:06 +09:00
tools Move darwin sysroot determination into separate file 2022-09-01 16:54:19 -07:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Remove unused configure variable. 2022-08-18 11:22:13 -04:00
Makefile.shlib aix: Fix SHLIB_EXPORTS reference in VPATH builds 2022-08-24 20:39:46 -07:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00