提交 e46039dc 编写于 作者: D Dhanashree Kashid

Increase the default GPORCA array expansion threshold to 100

It is common to have large IN/NOT IN list in user queries hence 25 is
too low of a bound.  After running several experiments, 100 turned out
to be good threshold value for this GUC.
Signed-off-by: NSambitesh Dash <sdash@pivotal.io>
上级 3a805c93
......@@ -2070,16 +2070,19 @@ fold_constants(PlannerGlobal *glob, Query *q, ParamListInfo boundParams, Size ma
/*
* Transform a small array constant to an ArrayExpr.
*
* This used by ORCA, to transform the array argument of a ScalarArrayExpr
* into an ArrayExpr. If a ScalarArrayExpr has an ArrayExpr argument, ORCA
* can perform some optimizations - partition pruning at least - based on
* the elements in the ArrayExpr. It doesn't currently know how to extract
* elements from an Array const, however, so to enable those optimizations
* in ORCA, we convert small Array Consts into corresponding ArrayExprs.
* This is used by ORCA, to transform the array argument of a ScalarArrayExpr
* into an ArrayExpr. If a ScalarArrayExpr has an ArrayExpr argument, ORCA can
* perform some optimizations - partition pruning at least - by first expanding
* the ArrayExpr into its disjunctive normal form and then deriving constraints
* based on the elements in the ArrayExpr. It doesn't currently know how to
* extract elements from an Array const, however, so to enable those
* optimizations in ORCA, we convert small Array Consts into corresponding
* ArrayExprs.
*
* If the argument is not an array constant or the number of elements in the
* array is greater than optimizer_array_expansion_threshold, returns the
* original Const unmodified.
* original Const unmodified since it is expensive to derive constraints for
* large arrays.
*/
Expr *
transform_array_Const_to_ArrayExpr(Const *c)
......
......@@ -3930,12 +3930,12 @@ struct config_int ConfigureNamesInt_gp[] =
{
{"optimizer_array_expansion_threshold", PGC_USERSET, QUERY_TUNING_METHOD,
gettext_noop("Item limit for expansion of arrays in WHERE clause to disjunctive form."),
gettext_noop("Item limit for expansion of arrays in WHERE clause for constraint derivation."),
NULL,
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&optimizer_array_expansion_threshold,
25, 0, INT_MAX, NULL, NULL
100, 0, INT_MAX, NULL, NULL
},
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册