hyperdx icon indicating copy to clipboard operation
hyperdx copied to clipboard

Full table scan in ClickHouse due to HyperDX query missing date filter

Open m0nikasingh opened this issue 5 months ago • 2 comments

I'm running HyperDX with an external ClickHouse and MongoDB setup. Our ClickHouse instance has the "force_index_by_date" setting enabled, which appears to conflict with some of the queries HyperDX runs.

For example, the following query does not include a time filter, which leads to a full table scan:

SELECT DISTINCT lowCardinalityKeys(arrayJoin(LogAttributes.keys)) AS key 
FROM otel.otel_logs 
LIMIT _CAST(1000, 'Int32') 
FORMAT JSON

Is there a recommended way to address this without disabling force_index_by_date? We'd like to avoid full scans, especially given the volume of data we're working with.

m0nikasingh avatar Jul 30 '25 00:07 m0nikasingh

it would not search whole table, see rows_max_to_read

zdyj3170101136 avatar Aug 01 '25 02:08 zdyj3170101136

Adding a time-range filter would significantly improve performance. Currently, when there are many rows, the CPU remains pinned at 100% for several minutes and eventually times out without returning results.

Image

Chihsiao avatar Sep 09 '25 10:09 Chihsiao