MCPcopy Create free account
hub / github.com/apache/cloudberry / RelationGetPartitionKey

Function RelationGetPartitionKey

src/backend/utils/cache/partcache.c:53–63  ·  view source on GitHub ↗

* RelationGetPartitionKey -- get partition key, if relation is partitioned * * Note: partition keys are not allowed to change after the partitioned rel * is created. RelationClearRelation knows this and preserves rd_partkey * across relcache rebuilds, as long as the relation is open. Therefore, * even though we hand back a direct pointer into the relcache entry, it's * safe for callers to

Source from the content-addressed store, hash-verified

51 * the relation open.
52 */
53PartitionKey
54RelationGetPartitionKey(Relation rel)
55{
56 if (rel->rd_rel->relkind != RELKIND_PARTITIONED_TABLE)
57 return NULL;
58
59 if (unlikely(rel->rd_partkey == NULL))
60 RelationBuildPartitionKey(rel);
61
62 return rel->rd_partkey;
63}
64
65/*
66 * RelationBuildPartitionKey

Callers 15

DefineIndexFunction · 0.85
GpFindTargetPartitionFunction · 0.85
AtExecGPSplitPartitionFunction · 0.85
DefineRelationFunction · 0.85
ATPrepCmdFunction · 0.85
transformPartitionCmdFunction · 0.85
generateRangePartitionsFunction · 0.85
generateListPartitionFunction · 0.85

Calls 1

Tested by

no test coverage detected