From 6c6fc58facfcf8545f46c8e38eae5efd7918aa59 Mon Sep 17 00:00:00 2001 From: jian he Date: Sat, 24 Feb 2024 19:12:18 +0800 Subject: [PATCH v1 1/1] Add enable_or_transformation doc entry enable_or_transformation GUC explanation. --- doc/src/sgml/config.sgml | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index ffd711b7..b14c5c0e 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -5276,6 +5276,60 @@ ANY num_sync ( + enable_or_transformation (boolean) + + enable_or_transformation configuration parameter + + + + + + Enables or disables the query planner's ability to transform mulitple expressions in () + to a ANY expression (). + This transformations only applys under the following condidtion: + + + +Each expression should be formed as: expression operator (expression). +The right-hand side of the operator should be just a plain constant. +The left-hand side of these expressions should remainn the same. + + + + + + + + Each expression form should return Boolean (true/false) result. + + + + + + + +These expressions are logically linked in a OR condition. + + + + The default is on. + + + For example, the following query without set enable_or_transformation, normally apply to three filter conditions seperately, + but if we set enable_or_transformation, then we can combine these three expressions to just one expression: unique1 = ANY ('{1,2,3}'::integer[]) . + +EXPLAIN SELECT * FROM tenk1 WHERE unique1 = 1 or unique1 = 2 or unique1 = 3; + + QUERY PLAN +------------------------------------------------------------- + Seq Scan on tenk1 (cost=0.00..482.50 rows=3 width=244) + Filter: (unique1 = ANY ('{1,2,3}'::integer[])) + + + + + enable_parallel_append (boolean) -- 2.34.1