mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Add a 'parallel_degree' reloption.
The code that estimates what parallel degree should be uesd for the scan of a relation is currently rather stupid, so add a parallel_degree reloption that can be used to override the planner's rather limited judgement. Julien Rouhaud, reviewed by David Rowley, James Sewell, Amit Kapila, and me. Some further hacking by me.
This commit is contained in:
@@ -206,6 +206,7 @@ typedef struct StdRdOptions
|
||||
AutoVacOpts autovacuum; /* autovacuum-related options */
|
||||
bool user_catalog_table; /* use as an additional catalog
|
||||
* relation */
|
||||
int parallel_degree; /* max number of parallel workers */
|
||||
} StdRdOptions;
|
||||
|
||||
#define HEAP_MIN_FILLFACTOR 10
|
||||
@@ -242,6 +243,14 @@ typedef struct StdRdOptions
|
||||
((relation)->rd_options ? \
|
||||
((StdRdOptions *) (relation)->rd_options)->user_catalog_table : false)
|
||||
|
||||
/*
|
||||
* RelationGetParallelDegree
|
||||
* Returns the relation's parallel_degree. Note multiple eval of argument!
|
||||
*/
|
||||
#define RelationGetParallelDegree(relation, defaultpd) \
|
||||
((relation)->rd_options ? \
|
||||
((StdRdOptions *) (relation)->rd_options)->parallel_degree : (defaultpd))
|
||||
|
||||
|
||||
/*
|
||||
* ViewOptions
|
||||
|
Reference in New Issue
Block a user