mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 03:22:14 +00:00
mayBenefitFromIndexForIn returns true if at least one tuple element is in pk [#CLICKHOUSE-3680]
This commit is contained in:
parent
ad137994f9
commit
a687c41a8c
@ -2195,12 +2195,11 @@ bool MergeTreeData::mayBenefitFromIndexForIn(const ASTPtr & left_in_operand) con
|
|||||||
if (left_in_operand_tuple && left_in_operand_tuple->name == "tuple")
|
if (left_in_operand_tuple && left_in_operand_tuple->name == "tuple")
|
||||||
{
|
{
|
||||||
for (const auto & item : left_in_operand_tuple->arguments->children)
|
for (const auto & item : left_in_operand_tuple->arguments->children)
|
||||||
if (!isPrimaryKeyColumnPossiblyWrappedInFunctions(item))
|
if (isPrimaryKeyColumnPossiblyWrappedInFunctions(item))
|
||||||
/// The tuple itself may be part of the primary key, so check that as a last resort.
|
return true;
|
||||||
return isPrimaryKeyColumnPossiblyWrappedInFunctions(left_in_operand);
|
|
||||||
|
|
||||||
/// tuple() is invalid but can still be found here since this method may be called before the arguments are validated.
|
/// The tuple itself may be part of the primary key, so check that as a last resort.
|
||||||
return !left_in_operand_tuple->arguments->children.empty();
|
return isPrimaryKeyColumnPossiblyWrappedInFunctions(left_in_operand);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user