mirror of https://github.com/citusdata/citus.git
CoPartitionedTables works with hash partitioning as well
parent
01bdab891b
commit
2e68203b6b
|
@ -139,8 +139,10 @@ static bool JoinOnPartitionColumn(Query *query);
|
||||||
static void ErrorIfUnsupportedShardDistribution(Query *query);
|
static void ErrorIfUnsupportedShardDistribution(Query *query);
|
||||||
static List * RelationIdList(Query *query);
|
static List * RelationIdList(Query *query);
|
||||||
static bool CoPartitionedTables(Oid firstRelationId, Oid secondRelationId);
|
static bool CoPartitionedTables(Oid firstRelationId, Oid secondRelationId);
|
||||||
static bool ShardIntervalsEqual(FmgrInfo *comparisonFunction, ShardInterval *firstInterval,
|
static bool ShardIntervalsEqual(FmgrInfo *comparisonFunction,
|
||||||
|
ShardInterval *firstInterval,
|
||||||
ShardInterval *secondInterval);
|
ShardInterval *secondInterval);
|
||||||
|
|
||||||
static void ErrorIfUnsupportedFilters(Query *subquery);
|
static void ErrorIfUnsupportedFilters(Query *subquery);
|
||||||
static bool EqualOpExpressionLists(List *firstOpExpressionList,
|
static bool EqualOpExpressionLists(List *firstOpExpressionList,
|
||||||
List *secondOpExpressionList);
|
List *secondOpExpressionList);
|
||||||
|
@ -3473,7 +3475,6 @@ RelationIdList(Query *query)
|
||||||
return relationIdList;
|
return relationIdList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CoPartitionedTables checks if given two distributed tables have 1-to-1 shard
|
* CoPartitionedTables checks if given two distributed tables have 1-to-1 shard
|
||||||
* partitioning. It uses shard interval array that are sorted on interval minimum
|
* partitioning. It uses shard interval array that are sorted on interval minimum
|
||||||
|
@ -3506,7 +3507,15 @@ CoPartitionedTables(Oid firstRelationId, Oid secondRelationId)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
typeId = sortedFirstIntervalArray[0].valueTypeId;
|
if (firstTableCache->partitionMethod == DISTRIBUTE_BY_HASH)
|
||||||
|
{
|
||||||
|
typeId = INT4OID;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
typeId = sortedFirstIntervalArray[0].valueTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
comparisonFunction = GetFunctionInfo(typeId, BTREE_AM_OID, BTORDER_PROC);
|
comparisonFunction = GetFunctionInfo(typeId, BTREE_AM_OID, BTORDER_PROC);
|
||||||
|
|
||||||
for (intervalIndex = 0; intervalIndex < firstListShardCount; intervalIndex++)
|
for (intervalIndex = 0; intervalIndex < firstListShardCount; intervalIndex++)
|
||||||
|
|
|
@ -2102,7 +2102,7 @@ SubquerySqlTaskList(Job *job)
|
||||||
* traffic.
|
* traffic.
|
||||||
*/
|
*/
|
||||||
if (anchorRangeTableId == 0 || prunedTableSize > maxPrunedTableSize){
|
if (anchorRangeTableId == 0 || prunedTableSize > maxPrunedTableSize){
|
||||||
maxTableSize = prunedTableSize;
|
maxPrunedTableSize = prunedTableSize;
|
||||||
anchorRangeTableId = tableId;
|
anchorRangeTableId = tableId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue