summaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/guc.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-03-24 11:47:41 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-03-24 11:47:41 -0400
commit0bd7af082ace135581bb13a6bd2d88e68c66a3e0 (patch)
tree412ad873ef762b761baaab0577cb4d36b6c0a240 /src/backend/utils/misc/guc.c
parenta47651447f01562dac2e007db03733e750d45b6b (diff)
Invent recursive_worktable_factor GUC to replace hard-wired constant.
Up to now, the planner estimated the size of a recursive query's worktable as 10 times the size of the non-recursive term. It's hard to see how to do significantly better than that automatically, but we can give users control over the multiplier to allow tuning for specific use-cases. The default behavior remains the same. Simon Riggs Discussion: https://postgr.es/m/CANbhV-EuaLm4H3g0+BSTYHEGxJj3Kht0R+rJ8vT57Dejnh=_nA@mail.gmail.com
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r--src/backend/utils/misc/guc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index f70f7f5c01e..b86137dc385 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -3741,6 +3741,18 @@ static struct config_real ConfigureNamesReal[] =
},
{
+ {"recursive_worktable_factor", PGC_USERSET, QUERY_TUNING_OTHER,
+ gettext_noop("Sets the planner's estimate of the average size "
+ "of a recursive query's working table."),
+ NULL,
+ GUC_EXPLAIN
+ },
+ &recursive_worktable_factor,
+ DEFAULT_RECURSIVE_WORKTABLE_FACTOR, 0.001, 1000000.0,
+ NULL, NULL, NULL
+ },
+
+ {
{"geqo_selection_bias", PGC_USERSET, QUERY_TUNING_GEQO,
gettext_noop("GEQO: selective pressure within the population."),
NULL,