summaryrefslogtreecommitdiff
path: root/src/include/partitioning
diff options
context:
space:
mode:
authorRobert Haas2018-11-19 17:10:41 +0000
committerRobert Haas2018-11-19 17:10:41 +0000
commit7ee5f88e650619ee619f7e2854ac50ff59d0b0c7 (patch)
tree75dd9c87255fe195b5eb623e6cc49b38aac7ce6c /src/include/partitioning
parent16fbac39ff68a737317f6fc7be78cc93a14856af (diff)
Reduce unnecessary list construction in RelationBuildPartitionDesc.
The 'partoids' list which was constructed by the previous version of this code was necessarily identical to 'inhoids'. There's no point to duplicating the list, so avoid that. Instead, construct the array representation directly from the original 'inhoids' list. Also, use an array rather than a list for 'boundspecs'. We know exactly how many items we need to store, so there's really no reason to use a list. Using an array instead reduces the number of memory allocations we perform. Patch by me, reviewed by Michael Paquier and Amit Langote, the latter of whom also helped with rebasing.
Diffstat (limited to 'src/include/partitioning')
-rw-r--r--src/include/partitioning/partbounds.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/include/partitioning/partbounds.h b/src/include/partitioning/partbounds.h
index 7a697d1c0a7..36fb584e23e 100644
--- a/src/include/partitioning/partbounds.h
+++ b/src/include/partitioning/partbounds.h
@@ -80,9 +80,8 @@ extern uint64 compute_partition_hash_value(int partnatts, FmgrInfo *partsupfunc,
Datum *values, bool *isnull);
extern List *get_qual_from_partbound(Relation rel, Relation parent,
PartitionBoundSpec *spec);
-extern PartitionBoundInfo partition_bounds_create(List *boundspecs,
- PartitionKey key,
- int **mapping);
+extern PartitionBoundInfo partition_bounds_create(PartitionBoundSpec **boundspecs,
+ int nparts, PartitionKey key, int **mapping);
extern bool partition_bounds_equal(int partnatts, int16 *parttyplen,
bool *parttypbyval, PartitionBoundInfo b1,
PartitionBoundInfo b2);