Engineering
Databend Cluster Key Best Practices: Choosing Columns, Key Order, and Granularity
Do not copy every frequently filtered column into CLUSTER BY. Start with the query families responsible for the most cumulative scanning, identify the selective predicates they share, match time granularity to the typical query window, and test alternative key orders under controlled conditions. Validate both the physical layout with clustering_information and the actual scan reduction with EXPLAIN ANALYZE, then compare the long-term query savings with the cost of maintaining that layout.



