postgresql/src/include/optimizer
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
..
appendinfo.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
clauses.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
cost.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_copy.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_gene.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_misc.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_mutation.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_pool.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_random.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_recombination.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_selection.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
inherit.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
joininfo.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
optimizer.h Transform OR clauses to ANY expression 2024-04-08 01:27:52 +03:00
orclauses.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
paramassign.h Add RETURNING support to MERGE. 2024-03-17 13:58:59 +00:00
pathnode.h Add support for MERGE ... WHEN NOT MATCHED BY SOURCE. 2024-03-30 10:00:26 +00:00
paths.h Do not translate dummy SpecialJoinInfos for child joins 2024-03-25 18:06:47 +09:00
placeholder.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
plancat.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
planmain.h Add better handling of redundant IS [NOT] NULL quals 2024-01-23 18:09:18 +13:00
planner.h Fix assert failure when planning setop subqueries with CTEs 2024-04-02 12:15:45 +13:00
prep.h Allow planner to use Merge Append to efficiently implement UNION 2024-03-25 14:31:14 +13:00
restrictinfo.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
subselect.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tlist.h Update copyright for 2024 2024-01-03 20:49:05 -05:00