From 75be66464cb1bffa1e5757907b9a04ad5afc7859 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 16 Jun 2016 13:47:20 -0400 Subject: Invent min_parallel_relation_size GUC to replace a hard-wired constant. The main point of doing this is to allow the cutoff to be set very small, even zero, to allow parallel-query behavior to be tested on relatively small tables such as we typically use in the regression tests. But it might be of use to users too. The number-of-workers scaling behavior in create_plain_partial_paths() is pretty ad-hoc and subject to change, so we won't expose anything about that, but the notion of not considering parallel query at all for tables below size X seems reasonably stable. Amit Kapila, per a suggestion from me Discussion: <17170.1465830165@sss.pgh.pa.us> --- src/backend/utils/misc/guc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/backend/utils/misc/guc.c') diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 9b02111a834..60148b871b3 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -2747,6 +2747,17 @@ static struct config_int ConfigureNamesInt[] = NULL, NULL, NULL }, + { + {"min_parallel_relation_size", PGC_USERSET, QUERY_TUNING_COST, + gettext_noop("Sets the minimum size of relations to be considered for parallel scan."), + NULL, + GUC_UNIT_BLOCKS, + }, + &min_parallel_relation_size, + 1024, 0, INT_MAX / 3, + NULL, NULL, NULL + }, + { /* Can't be set in postgresql.conf */ {"server_version_num", PGC_INTERNAL, PRESET_OPTIONS, -- cgit v1.2.3