mirror of https://github.com/citusdata/citus.git
Remove FastShardPruning method
With the other simplifications, it doesn't make sense to keep around.
Based on 93e3afc25c
pull/1385/head
parent
8afb4b9f33
commit
6dbd434f81
|
@ -2058,8 +2058,8 @@ TargetShardIntervalForModify(Query *query, DeferredErrorMessage **planningError)
|
|||
Var *partitionColumn = PartitionColumn(distributedTableId, rangeTableId);
|
||||
Const *partitionValueConst = ExtractInsertPartitionValue(query, partitionColumn);
|
||||
Datum partitionValue = partitionValueConst->constvalue;
|
||||
ShardInterval *shardInterval = FastShardPruning(distributedTableId,
|
||||
partitionValue);
|
||||
DistTableCacheEntry *cacheEntry = DistributedTableCacheEntry(distributedTableId);
|
||||
ShardInterval *shardInterval = FindShardInterval(partitionValue, cacheEntry);
|
||||
|
||||
if (shardInterval != NULL)
|
||||
{
|
||||
|
@ -2152,28 +2152,6 @@ FastShardPruningPossible(CmdType commandType, char partitionMethod)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* QueryRestrictList returns the restriction clauses for the query. For a SELECT
|
||||
* statement these are the where-clause expressions. For INSERT statements we
|
||||
|
|
|
@ -224,6 +224,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))
|
||||
|
@ -243,7 +244,7 @@ get_shard_id_for_distribution_column(PG_FUNCTION_ARGS)
|
|||
distributionValueDatum = StringToDatum(distributionValueString,
|
||||
distributionDataType);
|
||||
|
||||
shardInterval = FastShardPruning(relationId, distributionValueDatum);
|
||||
shardInterval = FindShardInterval(distributionValueDatum, cacheEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -45,7 +45,6 @@ extern RangeTblEntry * ExtractSelectRangeTableEntry(Query *query);
|
|||
extern RangeTblEntry * ExtractInsertRangeTableEntry(Query *query);
|
||||
extern void AddShardIntervalRestrictionToSelect(Query *subqery,
|
||||
ShardInterval *shardInterval);
|
||||
extern ShardInterval * FastShardPruning(Oid distributedTableId, Datum partitionValue);
|
||||
|
||||
|
||||
#endif /* MULTI_ROUTER_PLANNER_H */
|
||||
|
|
Loading…
Reference in New Issue