Efficient Query Writing for Dashboard

TLDR Vishnu asked for optimized query writing for dashboard performance. Ankit explained the efficiency differences between promQL and QueryBuilder/Clickhouse SQL queries.

Photo of Vishnu
Vishnu
Tue, 09 May 2023 12:51:45 UTC

Hi, What is the suggested/optimised way to write queries for dashboard? I saw better performance with native clickhouse queries compared to others. Do we have any benchmark regarding this?

Photo of Ankit
Ankit
Tue, 09 May 2023 15:39:49 UTC

`promQL` queries are not efficient as they pull raw data from clickhouse and then do the processing in-memory. It works in the same way Prometheus remote-read works and it is supposed to be inefficient by design.

Photo of Ankit
Ankit
Tue, 09 May 2023 15:40:12 UTC

QueryBuilder and Clickhouse SQL queries should be much faster as they use the clickhouse engine for processing and do not bring raw data to query-service

Photo of Vishnu
Vishnu
Tue, 09 May 2023 16:16:49 UTC

Thanks Ankit