v.24.8Experimental Feature

Added count_min Statistics Type for Selectivity Estimations in ClickHouse

Added statistics type count_min (count-min sketches) which provide selectivity estimations for equality predicates like col = 'val'. Supported data types are string, date, datatime and numeric types. #65521 (JackyWoo).
Added support for the count_min statistics type, introducing count-min sketches to provide selectivity estimations for equality predicates like col = 'val'. Supported data types include string, date, datetime, and numeric types.

Why it matters

This feature enables efficient and accurate selectivity estimation for equality filters, which improves query optimization and execution planning. By using count-min sketches, ClickHouse can better estimate the cardinality of filtered results without scanning full data, enhancing performance and resource utilization.

How to use it

Users can enable and utilize the count_min statistics type by defining it in the table's data skipping indices or statistics configurations for columns of supported types (string, date, datetime, numeric). This allows ClickHouse to gather and use count-min sketch statistics automatically during query optimization for predicates like col = 'val'.