v.22.8New Feature
Added exact_rows_before_limit setting for precise row statistics in ClickHouse
Added a settingexact_rows_before_limit(0/1). When enabled, ClickHouse will provide exact value forrows_before_limit_at_leaststatistic, but with the cost that the data before limit will have to be read completely. This closes #6613. #25333 (kevin wan).
Why it matters
This feature solves the problem of inaccuracy in therows_before_limit_at_least statistic by allowing users to get an exact count. It helps users understand the true number of rows processed before applying the LIMIT operation, at the cost of reading all data before the limit, improving query diagnostics and performance analysis.How to use it
Enable the feature by settingexact_rows_before_limit to 1 in your session or query settings, for example:sql<br>SET exact_rows_before_limit = 1<br>When enabled, the statistic
rows_before_limit_at_least will report the exact row count processed before the limit.