ClickHouse queries without raw timestamp filters bypass index optimization
warningperformanceUpdated Oct 30, 2025(via Exa)
Technologies:
How to detect:
ClickHouse queries that wrap timestamp columns in functions like toDate() instead of filtering on raw start_time prevent the database from efficiently using indexes and partition pruning, leading to full table scans and timeout errors on large datasets.
Recommended action:
Ensure all queries filter on raw start_time column directly without function wrapping. Always apply both fromTimestamp and toTimestamp filters to leverage ClickHouse's partitioning and indexing on project_id and time. This allows ClickHouse to skip irrelevant partitions and significantly improves query performance.