mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +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")
|
||||
{
|
||||
for (const auto & item : left_in_operand_tuple->arguments->children)
|
||||
if (!isPrimaryKeyColumnPossiblyWrappedInFunctions(item))
|
||||
if (isPrimaryKeyColumnPossiblyWrappedInFunctions(item))
|
||||
return true;
|
||||
|
||||
/// The tuple itself may be part of the primary key, so check that as a last resort.
|
||||
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.
|
||||
return !left_in_operand_tuple->arguments->children.empty();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user