mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Replace min_parallel_relation_size with two new GUCs.
When min_parallel_relation_size was added, the only supported type of parallel scan was a parallel sequential scan, but there are pending patches for parallel index scan, parallel index-only scan, and parallel bitmap heap scan. Those patches introduce two new types of complications: first, what's relevant is not really the total size of the relation but the portion of it that we will scan; and second, index pages and heap pages shouldn't necessarily be treated in exactly the same way. Typically, the number of index pages will be quite small, but that doesn't necessarily mean that a parallel index scan can't pay off. Therefore, we introduce min_parallel_table_scan_size, which works out a degree of parallelism for scans based on the number of table pages that will be scanned (and which is therefore equivalent to min_parallel_relation_size for parallel sequential scans) and also min_parallel_index_scan_size which can be used to work out a degree of parallelism based on the number of index pages that will be scanned. Amit Kapila and Robert Haas Discussion: http://postgr.es/m/CAA4eK1KowGSYYVpd2qPpaPPA5R90r++QwDFbrRECTE9H_HvpOg@mail.gmail.com Discussion: http://postgr.es/m/CAA4eK1+TnM4pXQbvn7OXqam+k_HZqb0ROZUMxOiL6DWJYCyYow@mail.gmail.com
This commit is contained in:
@ -2776,16 +2776,27 @@ static struct config_int ConfigureNamesInt[] =
|
||||
},
|
||||
|
||||
{
|
||||
{"min_parallel_relation_size", PGC_USERSET, QUERY_TUNING_COST,
|
||||
gettext_noop("Sets the minimum size of relations to be considered for parallel scan."),
|
||||
NULL,
|
||||
{"min_parallel_table_scan_size", PGC_USERSET, QUERY_TUNING_COST,
|
||||
gettext_noop("Sets the minimum amount of table data for a parallel scan."),
|
||||
gettext_noop("If the planner estimates that it will read a number of table pages too small to reach this limit, a parallel scan will not be considered."),
|
||||
GUC_UNIT_BLOCKS,
|
||||
},
|
||||
&min_parallel_relation_size,
|
||||
&min_parallel_table_scan_size,
|
||||
(8 * 1024 * 1024) / BLCKSZ, 0, INT_MAX / 3,
|
||||
NULL, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"min_parallel_index_scan_size", PGC_USERSET, QUERY_TUNING_COST,
|
||||
gettext_noop("Sets the minimum amount of index data for a parallel scan."),
|
||||
gettext_noop("If the planner estimates that it will read a number of index pages too small to reach this limit, a parallel scan will not be considered."),
|
||||
GUC_UNIT_BLOCKS,
|
||||
},
|
||||
&min_parallel_index_scan_size,
|
||||
(512 * 1024) / BLCKSZ, 0, INT_MAX / 3,
|
||||
NULL, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
/* Can't be set in postgresql.conf */
|
||||
{"server_version_num", PGC_INTERNAL, PRESET_OPTIONS,
|
||||
|
Reference in New Issue
Block a user