Count query performance

hello,

I ran some load test on influx and there are queries like select count(value) from measurement

I notice these take around 5sec from 1sec to 8sec aprox on some not that long term data

so I’m wondering is this just how influx works or is it indication of something else
are there any insights what does it do internally for 5 sec to check count on measurement?

Regards

SELECT COUNT(*) on a time series database is probably the worst query you can imagine, and no benchmarl should actually consider such queries as most TSDB will read all data to return an response with the total number of values.

1 Like

thanks makes sense just wanted to check

Regards,
Nikola

I have the same “issue”. What would be the best way to know the number of records in a measurement without using SELECT COUNT(*) ?

potentially having it as counter somewhere else