postgresql/src
Alexander Korotkov 72bd38cc99 Transform OR clauses to ANY expression
Replace (expr op C1) OR (expr op C2) ... with expr op ANY(ARRAY[C1, C2, ...])
on the preliminary stage of optimization when we are still working with the
expression tree.

Here Cn is a n-th constant expression, 'expr' is non-constant expression, 'op'
is an operator which returns boolean result and has a commuter (for the case
of reverse order of constant and non-constant parts of the expression,
like 'Cn op expr').

Sometimes it can lead to not optimal plan.  This is why there is a
or_to_any_transform_limit GUC.  It specifies a threshold value of length of
arguments in an OR expression that triggers the OR-to-ANY transformation.
Generally, more groupable OR arguments mean that transformation will be more
likely to win than to lose.

Discussion: https://postgr.es/m/567ED6CA.2040504%40sigaev.ru
Author: Alena Rybakina <lena.ribackina@yandex.ru>
Author: Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Reviewed-by: Peter Geoghegan <pg@bowt.ie>
Reviewed-by: Ranier Vilela <ranier.vf@gmail.com>
Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Reviewed-by: Jian He <jian.universality@gmail.com>
2024-04-08 01:27:52 +03:00
..
backend Transform OR clauses to ANY expression 2024-04-08 01:27:52 +03:00
bin Re-implement psql's FETCH_COUNT feature atop libpq's chunked mode. 2024-04-06 20:45:11 -04:00
common Silence some compiler warnings in commit 3311ea86ed 2024-04-05 16:08:40 -04:00
fe_utils Allow dbname to be written as part of connstring via pg_basebackup's -R option. 2024-03-21 10:50:33 +05:30
include Transform OR clauses to ANY expression 2024-04-08 01:27:52 +03:00
interfaces Support retrieval of results in chunks with libpq. 2024-04-06 20:45:11 -04:00
makefiles Optimize pg_popcount() with AVX-512 instructions. 2024-04-06 21:56:23 -05:00
pl Avoid possible longjmp-induced logic error in PLy_trigger_build_args. 2024-04-01 15:15:03 -04:00
port Optimize visibilitymap_count() with AVX-512 instructions. 2024-04-06 22:58:23 -05:00
template Remove AIX support 2024-02-28 15:17:23 +04:00
test Transform OR clauses to ANY expression 2024-04-08 01:27:52 +03:00
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools Transform OR clauses to ANY expression 2024-04-08 01:27:52 +03:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Optimize pg_popcount() with AVX-512 instructions. 2024-04-06 21:56:23 -05:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00