v.21.9New Feature

EXPLAIN query gains ESTIMATE mode for MergeTree tables

EXPLAIN query now has EXPLAIN ESTIMATE ... mode that will show information about read rows, marks and parts from MergeTree tables. Closes #23941. #26131 (fastio).
EXPLAIN ESTIMATE mode for the EXPLAIN query has been added, which provides detailed statistics about read rows, marks, and parts from MergeTree tables.

Why it matters

This feature helps users understand the estimated amount of data that will be read during query execution on MergeTree tables. It solves the problem of lacking insight into the volume of data processed, enabling better query optimization and performance tuning.

How to use it

Use the EXPLAIN ESTIMATE syntax followed by your query. For example:

EXPLAIN ESTIMATE SELECT * FROM table_name WHERE condition

This will display estimated read rows, marks, and parts information for MergeTree tables involved in the query.