v.1.1.54362New Feature

Using Index of MergeTree Tables with IN on Primary Key Tuples

An index of MergeTree tables is used when IN is applied to a tuple of expressions from the columns of the primary key. Example: WHERE (UserID, EventDate) IN ((123, '2000-01-01'), ...) (Anastasiya Tsarkova).
Added support for using an index of MergeTree tables when IN is applied to a tuple of expressions from primary key columns.

Why it matters

This feature improves query performance by allowing efficient use of primary key indexes when filtering tuples in IN conditions, enabling faster lookups and reduced query execution time.

How to use it

Use a WHERE clause with IN applied to tuples of primary key columns, for example:
sql<br>SELECT * FROM table WHERE (UserID, EventDate) IN ((123, '2000-01-01'), (456, '2001-02-02'))<br>
ClickHouse will automatically utilize the primary key index for such queries on MergeTree tables.