summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/optimizer/cost.h1
-rw-r--r--src/include/utils/rel.h25
2 files changed, 26 insertions, 0 deletions
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
index 1be93be0983..22e6db96b62 100644
--- a/src/include/optimizer/cost.h
+++ b/src/include/optimizer/cost.h
@@ -47,6 +47,7 @@ typedef enum
/* parameter variables and flags (see also optimizer.h) */
extern PGDLLIMPORT Cost disable_cost;
extern PGDLLIMPORT int max_parallel_workers_per_gather;
+extern PGDLLIMPORT bool enable_parallel_insert;
extern PGDLLIMPORT bool enable_seqscan;
extern PGDLLIMPORT bool enable_indexscan;
extern PGDLLIMPORT bool enable_indexonlyscan;
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index 10b63982c0a..5375a37dd19 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -306,6 +306,8 @@ typedef struct StdRdOptions
int parallel_workers; /* max number of parallel workers */
bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */
bool vacuum_truncate; /* enables vacuum to truncate a relation */
+ bool parallel_insert_enabled; /* enables planner's use of
+ * parallel insert */
} StdRdOptions;
#define HEAP_MIN_FILLFACTOR 10
@@ -424,6 +426,29 @@ typedef struct ViewOptions
VIEW_OPTION_CHECK_OPTION_CASCADED)
/*
+ * PartitionedTableRdOptions
+ * Contents of rd_options for partitioned tables
+ */
+typedef struct PartitionedTableRdOptions
+{
+ int32 vl_len_; /* varlena header (do not touch directly!) */
+ bool parallel_insert_enabled; /* enables planner's use of
+ * parallel insert */
+} PartitionedTableRdOptions;
+
+/*
+ * RelationGetParallelInsert
+ * Returns the relation's parallel_insert_enabled reloption setting.
+ * Note multiple eval of argument!
+ */
+#define RelationGetParallelInsert(relation, defaultpd) \
+ ((relation)->rd_options ? \
+ (relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE ? \
+ ((PartitionedTableRdOptions *) (relation)->rd_options)->parallel_insert_enabled : \
+ ((StdRdOptions *) (relation)->rd_options)->parallel_insert_enabled) : \
+ (defaultpd))
+
+/*
* RelationIsValid
* True iff relation descriptor is valid.
*/