mirror of https://github.com/citusdata/citus.git
Remove FastShardPruning method
With the other simplifications, it doesn't make sense to keep around.pull/1353/head
parent
42ee7c05f5
commit
93e3afc25c
|
@ -1974,8 +1974,9 @@ FindShardForInsert(Query *query, DeferredErrorMessage **planningError)
|
|||
if (partitionMethod == DISTRIBUTE_BY_HASH || partitionMethod == DISTRIBUTE_BY_RANGE)
|
||||
{
|
||||
Datum partitionValue = partitionValueConst->constvalue;
|
||||
ShardInterval *shardInterval = FastShardPruning(distributedTableId,
|
||||
partitionValue);
|
||||
DistTableCacheEntry *cacheEntry = DistributedTableCacheEntry(distributedTableId);
|
||||
ShardInterval *shardInterval = FindShardInterval(partitionValue, cacheEntry);
|
||||
|
||||
if (shardInterval != NULL)
|
||||
{
|
||||
prunedShardList = list_make1(shardInterval);
|
||||
|
@ -2047,28 +2048,6 @@ FindShardForInsert(Query *query, DeferredErrorMessage **planningError)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* FastShardPruning is a higher level API for FindShardInterval function. Given the
|
||||
* relationId of the distributed table and partitionValue, FastShardPruning function finds
|
||||
* the corresponding shard interval that the partitionValue should be in. FastShardPruning
|
||||
* returns NULL if no ShardIntervals exist for the given partitionValue.
|
||||
*/
|
||||
ShardInterval *
|
||||
FastShardPruning(Oid distributedTableId, Datum partitionValue)
|
||||
{
|
||||
DistTableCacheEntry *cacheEntry = DistributedTableCacheEntry(distributedTableId);
|
||||
ShardInterval *shardInterval = NULL;
|
||||
|
||||
/*
|
||||
* Call FindShardInterval to find the corresponding shard interval for the
|
||||
* given partition value.
|
||||
*/
|
||||
shardInterval = FindShardInterval(partitionValue, cacheEntry);
|
||||
|
||||
return shardInterval;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* FindShardForUpdateOrDelete finds the shard interval in which an UPDATE or
|
||||
* DELETE command should be applied, or sets planningError when the query
|
||||
|
|
|
@ -332,6 +332,7 @@ get_shard_id_for_distribution_column(PG_FUNCTION_ARGS)
|
|||
char *distributionValueString = NULL;
|
||||
Datum inputDatum = 0;
|
||||
Datum distributionValueDatum = 0;
|
||||
DistTableCacheEntry *cacheEntry = DistributedTableCacheEntry(relationId);
|
||||
|
||||
/* if given table is not reference table, distributionValue cannot be NULL */
|
||||
if (PG_ARGISNULL(1))
|
||||
|
@ -351,7 +352,7 @@ get_shard_id_for_distribution_column(PG_FUNCTION_ARGS)
|
|||
distributionValueDatum = StringToDatum(distributionValueString,
|
||||
distributionDataType);
|
||||
|
||||
shardInterval = FastShardPruning(relationId, distributionValueDatum);
|
||||
shardInterval = FindShardInterval(distributionValueDatum, cacheEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -44,7 +44,6 @@ extern void AddShardIntervalRestrictionToSelect(Query *subqery,
|
|||
ShardInterval *shardInterval);
|
||||
extern ShardInterval * FindShardForInsert(Query *query,
|
||||
DeferredErrorMessage **planningError);
|
||||
extern ShardInterval * FastShardPruning(Oid distributedTableId, Datum partitionValue);
|
||||
|
||||
|
||||
#endif /* MULTI_ROUTER_PLANNER_H */
|
||||
|
|
Loading…
Reference in New Issue