Clean up from code review

Only change to behavior is:
- don't ignore array const's constcollid in SAORestrictions
- don't end lines with commas in DebugLogPruningInstance
pull/3486/head
Philip Dubé 2020-02-13 23:24:10 +00:00
parent cdedb98c54
commit 7382c8be00
2 changed files with 216 additions and 214 deletions

View File

@ -7,8 +7,8 @@
* need to be queried to find rows matching the expression in a query. * need to be queried to find rows matching the expression in a query.
* *
* In PruneShards we first make a compact representation of the given * In PruneShards we first make a compact representation of the given
* query logical tree. This tree represent boolean operators and its * query logical tree. This tree represents boolean operators and its
* associated valid constrainst (expression nodes) and whether boolean * associated valid constraints (expression nodes) and whether boolean
* operator has associated unknown constraints. This allows essentially * operator has associated unknown constraints. This allows essentially
* unknown constraints to be replaced by a simple placeholder flag. * unknown constraints to be replaced by a simple placeholder flag.
* *
@ -17,7 +17,7 @@
* 1. AND(hash_col IN (1,2), OR(X, X)) * 1. AND(hash_col IN (1,2), OR(X, X))
* 2. AND(hash_col IN (1,2), OR(X)) * 2. AND(hash_col IN (1,2), OR(X))
* 3. AND(hash_col IN (1,2), X) * 3. AND(hash_col IN (1,2), X)
* Where X represents any (set of) unrecognized unprunable constraint(s). * Where X represents any set of unrecognized unprunable constraint(s).
* *
* Above allows the following pruning machinery to understand that * Above allows the following pruning machinery to understand that
* the target shard is determined solely by constraint: hash_col IN (1,2). * the target shard is determined solely by constraint: hash_col IN (1,2).
@ -93,6 +93,7 @@
#include "utils/memutils.h" #include "utils/memutils.h"
#include "utils/ruleutils.h" #include "utils/ruleutils.h"
/* /*
* Tree node for compact representation of the given query logical tree. * Tree node for compact representation of the given query logical tree.
* Represent a single boolean operator node and its associated * Represent a single boolean operator node and its associated
@ -101,7 +102,7 @@
typedef struct PruningTreeNode typedef struct PruningTreeNode
{ {
/* Indicates is this AND/OR boolean operator */ /* Indicates is this AND/OR boolean operator */
bool isAnd; BoolExprType boolop;
/* Does this boolean operator have unknown/unprunable constraint(s) */ /* Does this boolean operator have unknown/unprunable constraint(s) */
bool hasInvalidConstraints; bool hasInvalidConstraints;
@ -109,10 +110,7 @@ typedef struct PruningTreeNode
/* List of recognized valid prunable constraints of this boolean opearator */ /* List of recognized valid prunable constraints of this boolean opearator */
List *validConstraints; List *validConstraints;
/* /* Child boolean producing operators. Parents are always different from their children */
* Child boolean operators.
* Parent is always different boolean operator from its children.
*/
List *childBooleanNodes; List *childBooleanNodes;
} PruningTreeNode; } PruningTreeNode;
@ -141,7 +139,7 @@ typedef struct PruningInstance
/* /*
* Constraints on the partition column value. If multiple values are * Constraints on the partition column value. If multiple values are
* found the more restrictive one should be stored here. Even in case of * found the more restrictive one should be stored here. Even for
* a hash-partitioned table, actual column-values are stored here, *not* * a hash-partitioned table, actual column-values are stored here, *not*
* hashed values. * hashed values.
*/ */
@ -169,7 +167,7 @@ typedef struct PruningInstance
* When OR clauses are found, the non-ORed part (think of a < 3 AND (a > 5 * When OR clauses are found, the non-ORed part (think of a < 3 AND (a > 5
* OR a > 7)) of the expression is stored in one PruningInstance which is * OR a > 7)) of the expression is stored in one PruningInstance which is
* then copied for the ORed expressions. The original is marked as * then copied for the ORed expressions. The original is marked as
* isPartial, to avoid it being used for pruning. * isPartial, to avoid being used for pruning.
*/ */
bool isPartial; bool isPartial;
} PruningInstance; } PruningInstance;
@ -274,32 +272,13 @@ static int LowerShardBoundary(Datum partitionColumnValue,
ShardInterval **shardIntervalCache, ShardInterval **shardIntervalCache,
int shardCount, FunctionCallInfo compareFunction, int shardCount, FunctionCallInfo compareFunction,
bool includeMax); bool includeMax);
static inline PruningTreeNode * CreatePruningNode(bool isAnd); static PruningTreeNode * CreatePruningNode(BoolExprType boolop);
static inline OpExpr * SAORestrictionArrayEqualityOp( static OpExpr * SAORestrictionArrayEqualityOp(ScalarArrayOpExpr *arrayOperatorExpression,
ScalarArrayOpExpr *arrayOperatorExpression,
Var *partitionColumn); Var *partitionColumn);
static inline void DebugLogNode(char *fmt, Node *node, List *deparseCtx); static void DebugLogNode(char *fmt, Node *node, List *deparseCtx);
static void DebugLogPruningInstance(PruningInstance *pruning, List *deparseCtx);
static int ConstraintCount(PruningTreeNode *node);
#define AndBooleanNode() (CreatePruningNode(true))
#define OrBooleanNode() (CreatePruningNode(false))
#define IsAndOp(node) ((node)->isAnd)
#define IsOrOp(node) (!(node)->isAnd)
#define ConstraintCount(node) \
(list_length((node)->childBooleanNodes) + \
list_length((node)->validConstraints) + \
((node)->hasInvalidConstraints ? 1 : 0))
#define DebugLogPruningInstance(prune, deparseCtx) \
DebugLogNode("constraint value: %s, ", \
(Node *) (prune)->equalConsts, (deparseCtx)); \
DebugLogNode("constraint (lt) value: %s, ", \
(Node *) (prune)->lessConsts, (deparseCtx)); \
DebugLogNode("constraint (lteq) value: %s, ", \
(Node *) (prune)->lessEqualConsts, (deparseCtx)); \
DebugLogNode("constraint (gt) value: %s, ", \
(Node *) (prune)->greaterConsts, (deparseCtx)); \
DebugLogNode("constraint (gteq) value: %s, ", \
(Node *) (prune)->greaterEqualConsts, (deparseCtx));
/* /*
* PruneShards returns all shards from a distributed table that cannot be * PruneShards returns all shards from a distributed table that cannot be
@ -378,7 +357,7 @@ PruneShards(Oid relationId, Index rangeTableId, List *whereClauseList,
"a partition column comparator"))); "a partition column comparator")));
} }
PruningTreeNode *tree = AndBooleanNode(); PruningTreeNode *tree = CreatePruningNode(AND_EXPR);
PruningTreeBuildContext treeBuildContext = { 0 }; PruningTreeBuildContext treeBuildContext = { 0 };
treeBuildContext.current = tree; treeBuildContext.current = tree;
@ -393,7 +372,7 @@ PruneShards(Oid relationId, Index rangeTableId, List *whereClauseList,
/* Figure out what we can prune on */ /* Figure out what we can prune on */
PrunableExpressions(tree, &context); PrunableExpressions(tree, &context);
List *debugLoggedPruningInstances = NULL; List *debugLoggedPruningInstances = NIL;
/* /*
* Prune using each of the PrunableInstances we found, and OR results * Prune using each of the PrunableInstances we found, and OR results
@ -485,7 +464,7 @@ PruneShards(Oid relationId, Index rangeTableId, List *whereClauseList,
if (IsLoggableLevel(DEBUG3)) if (IsLoggableLevel(DEBUG3))
{ {
if (foundRestriction && debugLoggedPruningInstances) if (foundRestriction && debugLoggedPruningInstances != NIL)
{ {
List *deparseCtx = deparse_context_for("unknown", relationId); List *deparseCtx = deparse_context_for("unknown", relationId);
foreach(pruneCell, debugLoggedPruningInstances) foreach(pruneCell, debugLoggedPruningInstances)
@ -524,7 +503,7 @@ PruneShards(Oid relationId, Index rangeTableId, List *whereClauseList,
/* /*
* Check whether node is a valid constraint for pruning * IsValidConditionNode checks whether node is a valid constraint for pruning.
*/ */
static bool static bool
IsValidConditionNode(Node *node, Var *partitionColumn) IsValidConditionNode(Node *node, Var *partitionColumn)
@ -550,12 +529,7 @@ IsValidConditionNode(Node *node, Var *partitionColumn)
else if (IsA(node, ScalarArrayOpExpr)) else if (IsA(node, ScalarArrayOpExpr))
{ {
ScalarArrayOpExpr *arrayOperatorExpression = (ScalarArrayOpExpr *) node; ScalarArrayOpExpr *arrayOperatorExpression = (ScalarArrayOpExpr *) node;
if (SAORestrictions(arrayOperatorExpression, partitionColumn, NULL)) return SAORestrictions(arrayOperatorExpression, partitionColumn, NULL);
{
return true;
}
return false;
} }
else else
{ {
@ -565,7 +539,7 @@ IsValidConditionNode(Node *node, Var *partitionColumn)
/* /*
* Build a logical tree of valid constraints and invalid constaints for pruning. * BuildPruningTree builds a logical tree of constraints for pruning.
*/ */
static bool static bool
BuildPruningTree(Node *node, PruningTreeBuildContext *context) BuildPruningTree(Node *node, PruningTreeBuildContext *context)
@ -582,15 +556,14 @@ BuildPruningTree(Node *node, PruningTreeBuildContext *context)
else if (IsA(node, BoolExpr)) else if (IsA(node, BoolExpr))
{ {
BoolExpr *boolExpr = (BoolExpr *) node; BoolExpr *boolExpr = (BoolExpr *) node;
bool isAnded = boolExpr->boolop == AND_EXPR;
if (boolExpr->boolop == NOT_EXPR) if (boolExpr->boolop == NOT_EXPR)
{ {
return false; return false;
} }
else if (context->current->isAnd != isAnded) else if (context->current->boolop != boolExpr->boolop)
{ {
PruningTreeNode *child = CreatePruningNode(isAnded); PruningTreeNode *child = CreatePruningNode(boolExpr->boolop);
context->current->childBooleanNodes = lappend( context->current->childBooleanNodes = lappend(
context->current->childBooleanNodes, child); context->current->childBooleanNodes, child);
@ -624,14 +597,12 @@ BuildPruningTree(Node *node, PruningTreeBuildContext *context)
/* /*
* Simplifies the logical tree of valid and invalid constraints for pruning. * SimplifyPruningTree reduces logical tree of valid and invalid constraints for pruning.
* The goal is to remove any node having just a single constraint associated with it. * The goal is to remove any node having just a single constraint associated with it.
* This constraint is assigned to the parent logical node. * This constraint is assigned to the parent logical node.
* Removal of nodes is done by traversing from tree leafs upward.
* *
* For example logical tree of * For example 'AND(hash_col = 1, OR(X))' gets simplified to 'AND(hash_col = 1, X)',
* AND(hash_col = 1, OR(X)) gets simplified into AND(hash_col = 1, X) * where X is any unknown condition.
* Where X is any unknown condition.
*/ */
static void static void
SimplifyPruningTree(PruningTreeNode *node, PruningTreeNode *parent) SimplifyPruningTree(PruningTreeNode *node, PruningTreeNode *parent)
@ -649,11 +620,11 @@ SimplifyPruningTree(PruningTreeNode *node, PruningTreeNode *parent)
if (!parent) if (!parent)
{ {
/* Root is always ANDed expressions */ /* Root is always ANDed expressions */
Assert(IsAndOp(node)); Assert(node->boolop == AND_EXPR);
return; return;
} }
/* Boolean operator with just a single (regocnized/unknown) constraints gets simplified */ /* Boolean operator with single (recognized/unknown) constraint gets simplified */
if (ConstraintCount(node) <= 1) if (ConstraintCount(node) <= 1)
{ {
parent->validConstraints = list_concat(parent->validConstraints, parent->validConstraints = list_concat(parent->validConstraints,
@ -756,7 +727,7 @@ PrunableExpressionsWalker(PruningTreeNode *node, ClauseWalkerContext *context)
return; return;
} }
if (IsOrOp(node)) if (node->boolop == OR_EXPR)
{ {
/* /*
* "Queue" partial pruning instances. This is used to convert * "Queue" partial pruning instances. This is used to convert
@ -773,7 +744,7 @@ PrunableExpressionsWalker(PruningTreeNode *node, ClauseWalkerContext *context)
if (node->hasInvalidConstraints) if (node->hasInvalidConstraints)
{ {
PruningTreeNode *child = AndBooleanNode(); PruningTreeNode *child = CreatePruningNode(AND_EXPR);
child->hasInvalidConstraints = true; child->hasInvalidConstraints = true;
AddNewConjuction(context, child); AddNewConjuction(context, child);
@ -783,7 +754,7 @@ PrunableExpressionsWalker(PruningTreeNode *node, ClauseWalkerContext *context)
{ {
Node *constraint = (Node *) lfirst(cell); Node *constraint = (Node *) lfirst(cell);
PruningTreeNode *child = AndBooleanNode(); PruningTreeNode *child = CreatePruningNode(AND_EXPR);
child->validConstraints = list_make1(constraint); child->validConstraints = list_make1(constraint);
AddNewConjuction(context, child); AddNewConjuction(context, child);
@ -792,14 +763,14 @@ PrunableExpressionsWalker(PruningTreeNode *node, ClauseWalkerContext *context)
foreach(cell, node->childBooleanNodes) foreach(cell, node->childBooleanNodes)
{ {
PruningTreeNode *child = (PruningTreeNode *) lfirst(cell); PruningTreeNode *child = (PruningTreeNode *) lfirst(cell);
Assert(IsAndOp(child)); Assert(child->boolop == AND_EXPR);
AddNewConjuction(context, child); AddNewConjuction(context, child);
} }
return; return;
} }
Assert(IsAndOp(node)); Assert(node->boolop == AND_EXPR);
foreach(cell, node->validConstraints) foreach(cell, node->validConstraints)
{ {
@ -881,14 +852,14 @@ PrunableExpressionsWalker(PruningTreeNode *node, ClauseWalkerContext *context)
foreach(cell, node->childBooleanNodes) foreach(cell, node->childBooleanNodes)
{ {
PruningTreeNode *child = (PruningTreeNode *) lfirst(cell); PruningTreeNode *child = (PruningTreeNode *) lfirst(cell);
Assert(IsOrOp(child)); Assert(child->boolop == OR_EXPR);
PrunableExpressionsWalker(child, context); PrunableExpressionsWalker(child, context);
} }
} }
/* /*
* Check whether expression is a valid comparison of a var to a constant. * VarConstOpExprClause check whether an expression is a valid comparison of a Var to a Const.
* Also obtaining the var with constant when valid. * Also obtaining the var with constant when valid.
*/ */
static bool static bool
@ -946,21 +917,20 @@ AddSAOPartitionKeyRestrictionToInstance(ClauseWalkerContext *context,
ScalarArrayOpExpr *arrayOperatorExpression) ScalarArrayOpExpr *arrayOperatorExpression)
{ {
List *restrictions = NULL; List *restrictions = NULL;
if (SAORestrictions(arrayOperatorExpression, context->partitionColumn, &restrictions)) bool validSAORestriction PG_USED_FOR_ASSERTS_ONLY =
{ SAORestrictions(arrayOperatorExpression, context->partitionColumn, &restrictions);
PruningTreeNode *node = OrBooleanNode();
Assert(validSAORestriction);
PruningTreeNode *node = CreatePruningNode(OR_EXPR);
node->validConstraints = restrictions; node->validConstraints = restrictions;
AddNewConjuction(context, node); AddNewConjuction(context, node);
}
else
{
Assert(false);
}
} }
/* /*
* Check whether SAO constraint is valid. Also obtaining the built equality restrictions. * SAORestrictions checks whether an SAO constraint is valid.
* Also obtains equality restrictions.
*/ */
static bool static bool
SAORestrictions(ScalarArrayOpExpr *arrayOperatorExpression, Var *partitionColumn, SAORestrictions(ScalarArrayOpExpr *arrayOperatorExpression, Var *partitionColumn,
@ -977,11 +947,12 @@ SAORestrictions(ScalarArrayOpExpr *arrayOperatorExpression, Var *partitionColumn
equal(strippedLeftOpExpression, partitionColumn) && equal(strippedLeftOpExpression, partitionColumn) &&
IsA(arrayArgument, Const)) IsA(arrayArgument, Const))
{ {
Const *arrayConst = (Const *) arrayArgument;
int16 typlen = 0; int16 typlen = 0;
bool typbyval = false; bool typbyval = false;
char typalign = '\0'; char typalign = '\0';
Datum arrayElement = 0; Datum arrayElement = 0;
Datum inArray = ((Const *) arrayArgument)->constvalue; Datum inArray = arrayConst->constvalue;
bool isNull = false; bool isNull = false;
bool foundValid = false; bool foundValid = false;
@ -991,7 +962,7 @@ SAORestrictions(ScalarArrayOpExpr *arrayOperatorExpression, Var *partitionColumn
return false; return false;
} }
ArrayType *array = DatumGetArrayTypeP(((Const *) arrayArgument)->constvalue); ArrayType *array = DatumGetArrayTypeP(arrayConst->constvalue);
/* get the necessary information from array type to iterate over it */ /* get the necessary information from array type to iterate over it */
Oid elementType = ARR_ELEMTYPE(array); Oid elementType = ARR_ELEMTYPE(array);
@ -1018,8 +989,8 @@ SAORestrictions(ScalarArrayOpExpr *arrayOperatorExpression, Var *partitionColumn
if (requestedRestrictions) if (requestedRestrictions)
{ {
Const *constElement = makeConst(elementType, -1, Const *constElement = makeConst(elementType, -1,
DEFAULT_COLLATION_OID, typlen, arrayConst->constcollid,
arrayElement, typlen, arrayElement,
isNull, typbyval); isNull, typbyval);
/* build partcol = arrayelem operator */ /* build partcol = arrayelem operator */
@ -1067,7 +1038,8 @@ AddNewConjuction(ClauseWalkerContext *context, PruningTreeNode *node)
/* /*
* Check whether operator clause is valid restriction for partition column. * IsValidPartitionKeyRestriction check whether an operator clause is
* a valid restriction for comparing to a partition column.
*/ */
static bool static bool
IsValidPartitionKeyRestriction(OpExpr *opClause) IsValidPartitionKeyRestriction(OpExpr *opClause)
@ -1216,11 +1188,12 @@ AddPartitionKeyRestrictionToInstance(ClauseWalkerContext *context, OpExpr *opCla
/* /*
* Sometimes PostgreSQL chooses to try to wrap our Var in a coercion rather * TransformPartitionRestrictionValue works around how PostgreSQL sometimes
* than the Const; to deal with this, we strip the coercions from both and * chooses to try to wrap our Var in a coercion rather than the Const.
* manually coerce the Const into the type of our partition column. It is * To deal with this, we strip coercions from both and manually coerce
* conceivable that in some instances, this may not be possible; in those cases * the Const into the type of our partition column.
* we will simply fail to prune partitions based on this clause. * It is conceivable that in some instances this may not be possible,
* in those cases we will simply fail to prune partitions based on this clause.
*/ */
static Const * static Const *
TransformPartitionRestrictionValue(Var *partitionColumn, Const *restrictionValue) TransformPartitionRestrictionValue(Var *partitionColumn, Const *restrictionValue)
@ -1255,7 +1228,7 @@ TransformPartitionRestrictionValue(Var *partitionColumn, Const *restrictionValue
/* /*
* Check whether operator clause is valid restriction for hashed column. * IsValidHashRestriction checks whether an operator clause is a valid restriction for hashed column.
*/ */
static bool static bool
IsValidHashRestriction(OpExpr *opClause) IsValidHashRestriction(OpExpr *opClause)
@ -1824,8 +1797,7 @@ ExhaustivePrune(DistTableCacheEntry *cacheEntry, ClauseWalkerContext *context,
/* /*
* ExhaustivePruneOne returns true if curInterval is pruned away, false * ExhaustivePruneOne returns whether curInterval is pruned away.
* otherwise.
*/ */
static bool static bool
ExhaustivePruneOne(ShardInterval *curInterval, ExhaustivePruneOne(ShardInterval *curInterval,
@ -1912,11 +1884,11 @@ ExhaustivePruneOne(ShardInterval *curInterval,
/* /*
* Helper for creating a node for pruning tree * Helper for creating a node for pruning tree
*/ */
static inline PruningTreeNode * static PruningTreeNode *
CreatePruningNode(bool isAnd) CreatePruningNode(BoolExprType boolop)
{ {
PruningTreeNode *node = palloc0(sizeof(PruningTreeNode)); PruningTreeNode *node = palloc0(sizeof(PruningTreeNode));
node->isAnd = isAnd; node->boolop = boolop;
node->childBooleanNodes = NULL; node->childBooleanNodes = NULL;
node->validConstraints = NULL; node->validConstraints = NULL;
node->hasInvalidConstraints = false; node->hasInvalidConstraints = false;
@ -1925,9 +1897,10 @@ CreatePruningNode(bool isAnd)
/* /*
* Create equality operator for a single element of scalar array constraint. * SAORestrictionArrayEqualityOp creates an equality operator
* for a single element of a scalar array constraint.
*/ */
static inline OpExpr * static OpExpr *
SAORestrictionArrayEqualityOp(ScalarArrayOpExpr *arrayOperatorExpression, SAORestrictionArrayEqualityOp(ScalarArrayOpExpr *arrayOperatorExpression,
Var *partitionColumn) Var *partitionColumn)
{ {
@ -1944,16 +1917,45 @@ SAORestrictionArrayEqualityOp(ScalarArrayOpExpr *arrayOperatorExpression,
/* /*
* Debug helper for logging expression nodes * DebugLogNode is a helper for logging expression nodes.
*/ */
static inline void static void
DebugLogNode(char *fmt, Node *node, List *deparseCtx) DebugLogNode(char *fmt, Node *node, List *deparseCtx)
{ {
if (!node) if (node != NULL)
{ {
return;
}
char *deparsed = deparse_expression(node, deparseCtx, false, false); char *deparsed = deparse_expression(node, deparseCtx, false, false);
ereport(DEBUG3, (errmsg(fmt, deparsed))); ereport(DEBUG3, (errmsg(fmt, deparsed)));
}
}
/*
* DebugLogPruningInstance is a helper for logging purning constraints.
*/
static void
DebugLogPruningInstance(PruningInstance *pruning, List *deparseCtx)
{
DebugLogNode("constraint value: %s",
(Node *) pruning->equalConsts, deparseCtx);
DebugLogNode("constraint (lt) value: %s", \
(Node *) pruning->lessConsts, deparseCtx);
DebugLogNode("constraint (lteq) value: %s", \
(Node *) pruning->lessEqualConsts, deparseCtx);
DebugLogNode("constraint (gt) value: %s", \
(Node *) pruning->greaterConsts, deparseCtx);
DebugLogNode("constraint (gteq) value: %s",
(Node *) pruning->greaterEqualConsts, deparseCtx);
}
/*
* ConstraintCount returns how many arguments this node is taking.
*/
static int
ConstraintCount(PruningTreeNode *node)
{
return list_length(node->childBooleanNodes) +
list_length(node->validConstraints) +
(node->hasInvalidConstraints ? 1 : 0);
} }

View File

@ -219,14 +219,14 @@ SET client_min_messages TO DEBUG3;
-- Check that we support runing for ANY/IN with literal. -- Check that we support runing for ANY/IN with literal.
SELECT count(*) FROM lineitem_hash_part SELECT count(*) FROM lineitem_hash_part
WHERE l_orderkey = ANY ('{1,2,3}'); WHERE l_orderkey = ANY ('{1,2,3}');
DEBUG: constraint value: '1'::bigint COLLATE "default", DEBUG: constraint value: '1'::bigint
DEBUG: constraint value: '2'::bigint COLLATE "default", DEBUG: constraint value: '2'::bigint
DEBUG: constraint value: '3'::bigint COLLATE "default", DEBUG: constraint value: '3'::bigint
DEBUG: shard count: 3 DEBUG: shard count: 3
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: '1'::bigint COLLATE "default", DEBUG: constraint value: '1'::bigint
DEBUG: constraint value: '2'::bigint COLLATE "default", DEBUG: constraint value: '2'::bigint
DEBUG: constraint value: '3'::bigint COLLATE "default", DEBUG: constraint value: '3'::bigint
DEBUG: shard count: 3 DEBUG: shard count: 3
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -238,14 +238,14 @@ DEBUG: assigned task to node localhost:xxxxx
SELECT count(*) FROM lineitem_hash_part SELECT count(*) FROM lineitem_hash_part
WHERE l_orderkey IN (1,2,3); WHERE l_orderkey IN (1,2,3);
DEBUG: constraint value: '1'::bigint COLLATE "default", DEBUG: constraint value: '1'::bigint
DEBUG: constraint value: '2'::bigint COLLATE "default", DEBUG: constraint value: '2'::bigint
DEBUG: constraint value: '3'::bigint COLLATE "default", DEBUG: constraint value: '3'::bigint
DEBUG: shard count: 3 DEBUG: shard count: 3
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: '1'::bigint COLLATE "default", DEBUG: constraint value: '1'::bigint
DEBUG: constraint value: '2'::bigint COLLATE "default", DEBUG: constraint value: '2'::bigint
DEBUG: constraint value: '3'::bigint COLLATE "default", DEBUG: constraint value: '3'::bigint
DEBUG: shard count: 3 DEBUG: shard count: 3
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -356,8 +356,8 @@ DEBUG: assigned task to node localhost:xxxxx
SELECT count(*) FROM lineitem SELECT count(*) FROM lineitem
WHERE l_orderkey >= 1 AND l_orderkey <= 3; WHERE l_orderkey >= 1 AND l_orderkey <= 3;
DEBUG: Router planner does not support append-partitioned tables. DEBUG: Router planner does not support append-partitioned tables.
DEBUG: constraint (lteq) value: '3'::bigint, DEBUG: constraint (lteq) value: '3'::bigint
DEBUG: constraint (gteq) value: '1'::bigint, DEBUG: constraint (gteq) value: '1'::bigint
DEBUG: shard count: 1 DEBUG: shard count: 1
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
count count
@ -368,8 +368,8 @@ DEBUG: assigned task to node localhost:xxxxx
SELECT count(*) FROM lineitem SELECT count(*) FROM lineitem
WHERE (l_orderkey >= 1 AND l_orderkey <= 3) AND (l_quantity > 11 AND l_quantity < 22); WHERE (l_orderkey >= 1 AND l_orderkey <= 3) AND (l_quantity > 11 AND l_quantity < 22);
DEBUG: Router planner does not support append-partitioned tables. DEBUG: Router planner does not support append-partitioned tables.
DEBUG: constraint (lteq) value: '3'::bigint, DEBUG: constraint (lteq) value: '3'::bigint
DEBUG: constraint (gteq) value: '1'::bigint, DEBUG: constraint (gteq) value: '1'::bigint
DEBUG: shard count: 1 DEBUG: shard count: 1
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
count count
@ -381,9 +381,9 @@ DEBUG: assigned task to node localhost:xxxxx
SELECT count(*) FROM lineitem SELECT count(*) FROM lineitem
WHERE l_orderkey = ANY ('{1,2,3}'); WHERE l_orderkey = ANY ('{1,2,3}');
DEBUG: Router planner does not support append-partitioned tables. DEBUG: Router planner does not support append-partitioned tables.
DEBUG: constraint value: '1'::bigint COLLATE "default", DEBUG: constraint value: '1'::bigint
DEBUG: constraint value: '2'::bigint COLLATE "default", DEBUG: constraint value: '2'::bigint
DEBUG: constraint value: '3'::bigint COLLATE "default", DEBUG: constraint value: '3'::bigint
DEBUG: shard count: 1 DEBUG: shard count: 1
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
count count
@ -394,9 +394,9 @@ DEBUG: assigned task to node localhost:xxxxx
SELECT count(*) FROM lineitem SELECT count(*) FROM lineitem
WHERE l_orderkey IN (1,2,3); WHERE l_orderkey IN (1,2,3);
DEBUG: Router planner does not support append-partitioned tables. DEBUG: Router planner does not support append-partitioned tables.
DEBUG: constraint value: '1'::bigint COLLATE "default", DEBUG: constraint value: '1'::bigint
DEBUG: constraint value: '2'::bigint COLLATE "default", DEBUG: constraint value: '2'::bigint
DEBUG: constraint value: '3'::bigint COLLATE "default", DEBUG: constraint value: '3'::bigint
DEBUG: shard count: 1 DEBUG: shard count: 1
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
count count
@ -418,9 +418,9 @@ DEBUG: assigned task to node localhost:xxxxx
SELECT count(*) FROM lineitem_range SELECT count(*) FROM lineitem_range
WHERE l_orderkey = ANY ('{1,2,3}'); WHERE l_orderkey = ANY ('{1,2,3}');
DEBUG: constraint value: '1'::bigint COLLATE "default", DEBUG: constraint value: '1'::bigint
DEBUG: constraint value: '2'::bigint COLLATE "default", DEBUG: constraint value: '2'::bigint
DEBUG: constraint value: '3'::bigint COLLATE "default", DEBUG: constraint value: '3'::bigint
DEBUG: shard count: 1 DEBUG: shard count: 1
DEBUG: Creating router plan DEBUG: Creating router plan
DEBUG: Plan is router executable DEBUG: Plan is router executable
@ -431,9 +431,9 @@ DEBUG: Plan is router executable
SELECT count(*) FROM lineitem_range SELECT count(*) FROM lineitem_range
WHERE l_orderkey IN (1,2,3); WHERE l_orderkey IN (1,2,3);
DEBUG: constraint value: '1'::bigint COLLATE "default", DEBUG: constraint value: '1'::bigint
DEBUG: constraint value: '2'::bigint COLLATE "default", DEBUG: constraint value: '2'::bigint
DEBUG: constraint value: '3'::bigint COLLATE "default", DEBUG: constraint value: '3'::bigint
DEBUG: shard count: 1 DEBUG: shard count: 1
DEBUG: Creating router plan DEBUG: Creating router plan
DEBUG: Plan is router executable DEBUG: Plan is router executable
@ -526,7 +526,7 @@ DEBUG: assigned task to node localhost:xxxxx
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = (random() + 100) AND o_orderkey = 1; WHERE o_orderkey = (random() + 100) AND o_orderkey = 1;
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: shard count: 1 DEBUG: shard count: 1
DEBUG: Creating router plan DEBUG: Creating router plan
DEBUG: Plan is router executable DEBUG: Plan is router executable
@ -575,9 +575,9 @@ SELECT count(*)
WHERE orders1.o_orderkey = orders2.o_orderkey WHERE orders1.o_orderkey = orders2.o_orderkey
AND orders1.o_orderkey = 1 AND orders1.o_orderkey = 1
AND orders2.o_orderkey is NULL; AND orders2.o_orderkey is NULL;
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: shard count: 1 DEBUG: shard count: 1
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: shard count: 1 DEBUG: shard count: 1
DEBUG: Creating router plan DEBUG: Creating router plan
DEBUG: Plan is router executable DEBUG: Plan is router executable
@ -606,7 +606,7 @@ DEBUG: assigned task to node localhost:xxxxx
-- Shards restricted correctly with prunable constraint -- Shards restricted correctly with prunable constraint
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1; WHERE o_orderkey = 1;
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: shard count: 1 DEBUG: shard count: 1
DEBUG: Creating router plan DEBUG: Creating router plan
DEBUG: Plan is router executable DEBUG: Plan is router executable
@ -619,7 +619,7 @@ DETAIL: distribution column value: 1
-- Shards restricted correctly with prunable constraint ANDed with unprunable expression using OR -- Shards restricted correctly with prunable constraint ANDed with unprunable expression using OR
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 AND (o_custkey = 11 OR o_custkey = 22); WHERE o_orderkey = 1 AND (o_custkey = 11 OR o_custkey = 22);
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: shard count: 1 DEBUG: shard count: 1
DEBUG: Creating router plan DEBUG: Creating router plan
DEBUG: Plan is router executable DEBUG: Plan is router executable
@ -632,12 +632,12 @@ DETAIL: distribution column value: 1
-- Shards restricted correctly with prunable constraints ORed -- Shards restricted correctly with prunable constraints ORed
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE (o_orderkey = 1 OR o_orderkey = 2); WHERE (o_orderkey = 1 OR o_orderkey = 2);
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -649,12 +649,12 @@ DEBUG: assigned task to node localhost:xxxxx
-- Shards restricted correctly with prunable constraints ANDed with unprunable expression using OR -- Shards restricted correctly with prunable constraints ANDed with unprunable expression using OR
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE (o_orderkey = 1 OR o_orderkey = 2) AND (o_custkey = 11 OR o_custkey = 22); WHERE (o_orderkey = 1 OR o_orderkey = 2) AND (o_custkey = 11 OR o_custkey = 22);
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -666,16 +666,16 @@ DEBUG: assigned task to node localhost:xxxxx
-- Shards restricted correctly with many different prunable constraints ORed -- Shards restricted correctly with many different prunable constraints ORed
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE (o_orderkey = 1 AND o_custkey = 11) OR (o_orderkey = 1 AND o_custkey = 33) OR (o_orderkey = 2 AND o_custkey = 22) OR (o_orderkey = 2 AND o_custkey = 44); WHERE (o_orderkey = 1 AND o_custkey = 11) OR (o_orderkey = 1 AND o_custkey = 33) OR (o_orderkey = 2 AND o_custkey = 22) OR (o_orderkey = 2 AND o_custkey = 44);
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -687,12 +687,12 @@ DEBUG: assigned task to node localhost:xxxxx
-- Shards restricted correctly with prunable SAO constraint ANDed with unprunable expression using OR -- Shards restricted correctly with prunable SAO constraint ANDed with unprunable expression using OR
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE (o_orderkey IN (1,2)) AND (o_custkey = 11 OR o_custkey = 22 OR o_custkey = 33); WHERE (o_orderkey IN (1,2)) AND (o_custkey = 11 OR o_custkey = 22 OR o_custkey = 33);
DEBUG: constraint value: 1 COLLATE "default", DEBUG: constraint value: 1
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: 1 COLLATE "default", DEBUG: constraint value: 1
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -704,12 +704,12 @@ DEBUG: assigned task to node localhost:xxxxx
-- Shards restricted correctly with prunable SAO constraint ANDed with multiple unprunable expressions -- Shards restricted correctly with prunable SAO constraint ANDed with multiple unprunable expressions
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE (o_orderkey IN (1,2)) AND (o_totalprice < 11 OR o_totalprice > 19) AND o_shippriority > 100 AND (o_custkey = 11 OR o_custkey = 22); WHERE (o_orderkey IN (1,2)) AND (o_totalprice < 11 OR o_totalprice > 19) AND o_shippriority > 100 AND (o_custkey = 11 OR o_custkey = 22);
DEBUG: constraint value: 1 COLLATE "default", DEBUG: constraint value: 1
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: 1 COLLATE "default", DEBUG: constraint value: 1
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -721,16 +721,16 @@ DEBUG: assigned task to node localhost:xxxxx
-- Shards restricted correctly with prunable SAO constraints ORed -- Shards restricted correctly with prunable SAO constraints ORed
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE (o_orderkey IN (1,2) AND o_custkey = 11) OR (o_orderkey IN (2,3) AND o_custkey = 22); WHERE (o_orderkey IN (1,2) AND o_custkey = 11) OR (o_orderkey IN (2,3) AND o_custkey = 22);
DEBUG: constraint value: 1 COLLATE "default", DEBUG: constraint value: 1
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: constraint value: 3 COLLATE "default", DEBUG: constraint value: 3
DEBUG: shard count: 3 DEBUG: shard count: 3
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: 1 COLLATE "default", DEBUG: constraint value: 1
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: constraint value: 3 COLLATE "default", DEBUG: constraint value: 3
DEBUG: shard count: 3 DEBUG: shard count: 3
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -760,14 +760,14 @@ DEBUG: assigned task to node localhost:xxxxx
-- Shards restricted correctly with prunable constraint ORed -- Shards restricted correctly with prunable constraint ORed
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 OR ((o_orderkey = 2 AND o_custkey = 22) OR (o_orderkey = 3 AND o_custkey = 33)); WHERE o_orderkey = 1 OR ((o_orderkey = 2 AND o_custkey = 22) OR (o_orderkey = 3 AND o_custkey = 33));
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: constraint value: 3, DEBUG: constraint value: 3
DEBUG: shard count: 3 DEBUG: shard count: 3
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: constraint value: 3, DEBUG: constraint value: 3
DEBUG: shard count: 3 DEBUG: shard count: 3
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -780,12 +780,12 @@ DEBUG: assigned task to node localhost:xxxxx
-- Shards restricted correctly with prunable constraint ORed with falsy expression -- Shards restricted correctly with prunable constraint ORed with falsy expression
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 OR (o_orderkey = 2 AND (o_custkey = 11 OR (o_orderkey = 3 AND o_custkey = 44))); WHERE o_orderkey = 1 OR (o_orderkey = 2 AND (o_custkey = 11 OR (o_orderkey = 3 AND o_custkey = 44)));
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -797,12 +797,12 @@ DEBUG: assigned task to node localhost:xxxxx
-- Shards restricted correctly with prunable SAO constraint ORed with prunable nested EQ constraint -- Shards restricted correctly with prunable SAO constraint ORed with prunable nested EQ constraint
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE (o_orderkey IN (1,2)) AND (o_custkey = 11 OR o_custkey = 22 OR o_custkey = 33) AND o_totalprice <= 20; WHERE (o_orderkey IN (1,2)) AND (o_custkey = 11 OR o_custkey = 22 OR o_custkey = 33) AND o_totalprice <= 20;
DEBUG: constraint value: 1 COLLATE "default", DEBUG: constraint value: 1
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: 1 COLLATE "default", DEBUG: constraint value: 1
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -814,12 +814,12 @@ DEBUG: assigned task to node localhost:xxxxx
-- Shards restricted correctly with prunable SAO constraint ANDed with unprunable expressions -- Shards restricted correctly with prunable SAO constraint ANDed with unprunable expressions
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE (o_orderkey IN (1,2)) AND (o_custkey = 11 OR o_custkey = 33) AND o_custkey = 22; WHERE (o_orderkey IN (1,2)) AND (o_custkey = 11 OR o_custkey = 33) AND o_custkey = 22;
DEBUG: constraint value: 1 COLLATE "default", DEBUG: constraint value: 1
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: 1 COLLATE "default", DEBUG: constraint value: 1
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: shard count: 2 DEBUG: shard count: 2
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -848,14 +848,14 @@ DEBUG: assigned task to node localhost:xxxxx
-- Shards restricted correctly with prunable SAO constraint ORed with prunable nested EQ constraint -- Shards restricted correctly with prunable SAO constraint ORed with prunable nested EQ constraint
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE ((o_orderkey IN (1,2)) AND (o_custkey = 11 OR o_custkey = 22)) OR (o_orderkey = 3 AND o_custkey = 33); WHERE ((o_orderkey IN (1,2)) AND (o_custkey = 11 OR o_custkey = 22)) OR (o_orderkey = 3 AND o_custkey = 33);
DEBUG: constraint value: 3, DEBUG: constraint value: 3
DEBUG: constraint value: 1 COLLATE "default", DEBUG: constraint value: 1
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: shard count: 3 DEBUG: shard count: 3
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: 3, DEBUG: constraint value: 3
DEBUG: constraint value: 1 COLLATE "default", DEBUG: constraint value: 1
DEBUG: constraint value: 2 COLLATE "default", DEBUG: constraint value: 2
DEBUG: shard count: 3 DEBUG: shard count: 3
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
@ -885,7 +885,7 @@ DEBUG: assigned task to node localhost:xxxxx
-- Single shard used when deeply nested prunable expression is restrictive with nested ANDs -- Single shard used when deeply nested prunable expression is restrictive with nested ANDs
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 OR (o_orderkey = 2 AND (o_orderkey = 3 OR (o_orderkey = 1 AND o_custkey = 11))); WHERE o_orderkey = 1 OR (o_orderkey = 2 AND (o_orderkey = 3 OR (o_orderkey = 1 AND o_custkey = 11)));
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: shard count: 1 DEBUG: shard count: 1
DEBUG: Creating router plan DEBUG: Creating router plan
DEBUG: Plan is router executable DEBUG: Plan is router executable
@ -910,14 +910,14 @@ DETAIL: distribution column value: 1
-- Deeply nested prunable expression affects used shards -- Deeply nested prunable expression affects used shards
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 OR ((o_orderkey = 2 OR o_orderkey = 3) AND (o_custkey = 22 OR o_custkey = 33)); WHERE o_orderkey = 1 OR ((o_orderkey = 2 OR o_orderkey = 3) AND (o_custkey = 22 OR o_custkey = 33));
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: constraint value: 3, DEBUG: constraint value: 3
DEBUG: shard count: 3 DEBUG: shard count: 3
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: constraint value: 1, DEBUG: constraint value: 1
DEBUG: constraint value: 2, DEBUG: constraint value: 2
DEBUG: constraint value: 3, DEBUG: constraint value: 3
DEBUG: shard count: 3 DEBUG: shard count: 3
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx
DEBUG: assigned task to node localhost:xxxxx DEBUG: assigned task to node localhost:xxxxx