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)
|
if (partitionMethod == DISTRIBUTE_BY_HASH || partitionMethod == DISTRIBUTE_BY_RANGE)
|
||||||
{
|
{
|
||||||
Datum partitionValue = partitionValueConst->constvalue;
|
Datum partitionValue = partitionValueConst->constvalue;
|
||||||
ShardInterval *shardInterval = FastShardPruning(distributedTableId,
|
DistTableCacheEntry *cacheEntry = DistributedTableCacheEntry(distributedTableId);
|
||||||
partitionValue);
|
ShardInterval *shardInterval = FindShardInterval(partitionValue, cacheEntry);
|
||||||
|
|
||||||
if (shardInterval != NULL)
|
if (shardInterval != NULL)
|
||||||
{
|
{
|
||||||
prunedShardList = list_make1(shardInterval);
|
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
|
* FindShardForUpdateOrDelete finds the shard interval in which an UPDATE or
|
||||||
* DELETE command should be applied, or sets planningError when the query
|
* 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;
|
char *distributionValueString = NULL;
|
||||||
Datum inputDatum = 0;
|
Datum inputDatum = 0;
|
||||||
Datum distributionValueDatum = 0;
|
Datum distributionValueDatum = 0;
|
||||||
|
DistTableCacheEntry *cacheEntry = DistributedTableCacheEntry(relationId);
|
||||||
|
|
||||||
/* if given table is not reference table, distributionValue cannot be NULL */
|
/* if given table is not reference table, distributionValue cannot be NULL */
|
||||||
if (PG_ARGISNULL(1))
|
if (PG_ARGISNULL(1))
|
||||||
|
@ -351,7 +352,7 @@ get_shard_id_for_distribution_column(PG_FUNCTION_ARGS)
|
||||||
distributionValueDatum = StringToDatum(distributionValueString,
|
distributionValueDatum = StringToDatum(distributionValueString,
|
||||||
distributionDataType);
|
distributionDataType);
|
||||||
|
|
||||||
shardInterval = FastShardPruning(relationId, distributionValueDatum);
|
shardInterval = FindShardInterval(distributionValueDatum, cacheEntry);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,6 @@ extern void AddShardIntervalRestrictionToSelect(Query *subqery,
|
||||||
ShardInterval *shardInterval);
|
ShardInterval *shardInterval);
|
||||||
extern ShardInterval * FindShardForInsert(Query *query,
|
extern ShardInterval * FindShardForInsert(Query *query,
|
||||||
DeferredErrorMessage **planningError);
|
DeferredErrorMessage **planningError);
|
||||||
extern ShardInterval * FastShardPruning(Oid distributedTableId, Datum partitionValue);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* MULTI_ROUTER_PLANNER_H */
|
#endif /* MULTI_ROUTER_PLANNER_H */
|
||||||
|
|
Loading…
Reference in New Issue