mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 16:50:48 +00:00
Fix index analysis for set index
This commit is contained in:
parent
77d461609c
commit
b3a8ad124f
@ -451,9 +451,9 @@ bool MergeTreeIndexConditionSet::checkASTUseless(const ASTPtr & node, bool atomi
|
|||||||
const ASTs & args = func->arguments->children;
|
const ASTs & args = func->arguments->children;
|
||||||
|
|
||||||
if (func->name == "and" || func->name == "indexHint")
|
if (func->name == "and" || func->name == "indexHint")
|
||||||
return checkASTUseless(args[0], atomic) && checkASTUseless(args[1], atomic);
|
return std::all_of(args.begin(), args.end(), [this, atomic](const auto & arg) { return checkASTUseless(arg, atomic); });
|
||||||
else if (func->name == "or")
|
else if (func->name == "or")
|
||||||
return checkASTUseless(args[0], atomic) || checkASTUseless(args[1], atomic);
|
return std::any_of(args.begin(), args.end(), [this, atomic](const auto & arg) { return checkASTUseless(arg, atomic); });
|
||||||
else if (func->name == "not")
|
else if (func->name == "not")
|
||||||
return checkASTUseless(args[0], atomic);
|
return checkASTUseless(args[0], atomic);
|
||||||
else
|
else
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
drop table if exists set_index;
|
||||||
|
|
||||||
|
create table set_index (a Int32, b Int32, INDEX b_set b type set(0) granularity 1) engine MergeTree order by tuple();
|
||||||
|
insert into set_index values (1, 2);
|
||||||
|
|
||||||
|
select b from set_index where a = 1 and a = 1 and b = 1 settings force_data_skipping_indices = 'b_set', optimize_move_to_prewhere=0;
|
Loading…
Reference in New Issue
Block a user