v.24.8Experimental Feature
Added count_min Statistics Type for Selectivity Estimations in ClickHouse
Added statistics typecount_min(count-min sketches) which provide selectivity estimations for equality predicates likecol = 'val'. Supported data types are string, date, datatime and numeric types. #65521 (JackyWoo).
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 thecount_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'.