ClickHouse: IN operator much slower on 23.6.1 than on 23.4.2.11
(you don’t have to strictly follow this form)
Describe the unexpected behaviour I have a merge table (say) t_merge, and a memory table t_memory. on version 23.4.2.11, I use IN operator to query records from t_merge, by "where (xx, xxx) in t_memory). It is really quick than “t_merge left semi join t_memory”. that is 100ms vs 6s. but when upgrade to version 23.6.1, the IN operator slow down to 6s, almost same as “left semi join”. what is wrong?
How to reproduce
- Which ClickHouse server version to use - 23.6.1
- Which interface to use, if matters - JetBrains DataGrip with http
- Non-default settings, if any
CREATE TABLE
statements for all tables involved- Sample data for all these tables, use clickhouse-obfuscator if necessary
- Queries to run that lead to unexpected result
Expected behavior IN operator performance better.
Error message and/or stacktrace If applicable, add screenshots to help explain your problem.
Additional context there is some signal may related: that seems clickhouse server return rows quickly just as former version, (not sure all or just part of them). then after several seconds it show query finished. maybe server finished work already, but block for a while then finish the query process?
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 24 (16 by maintainers)
It’s because of PREWHERE 23.6 https://fiddle.clickhouse.com/328cc4c9-89c0-4986-a598-428a332f3374 23.5 https://fiddle.clickhouse.com/58e44697-7e9b-40ec-a589-f2de0294b8db It seems to be fixed in 23.7: https://fiddle.clickhouse.com/09e9e066-8da4-4145-a9b2-c9b7404801ec