No of query count is different is diff b/w click house db and QAN

I observed that query count is a difference between Click House DB and QAN.

I have a query, and I have selected the query count for Yesterday in both the QAN and Click House DB, but the query count is not accurate. Please find the attachments below.

Can someone please help me, why I see the difference?

Can someone please help me with the above issue?

Hi @Naresh9999.
Your query in Explore counts the number of Clickhouse lines with this fingerprint.
What you need is the sum for the count field.
See the Advanced Query Analysis in Percona Monitoring and Management with Direct ClickHouse Access for detail.
I think you need the ‘num_queries’ field.


What I really want to know is how many times the database query for the application was executed per day.

Is the num_queries column the exact count of that particular query?

As per the below screenshot, the Yesterday query count is 7137 times?

@Naresh9999 I would recommend using Query id for grouping.
Here is my example:

The numbers are matching.

I got it @Roma_Novikov

Thanks for the query.