# QAN showing query which are not running during the time range selected

**URL:** https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713
**Category:** PMM 3.x
**Tags:** pmm, postgres, postgresql
**Created:** [April 24, 2025, 9:20am UTC](https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713 "2025-04-24T09:20:10Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![aniruddha.deshpande](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aniruddha.deshpande](https://forums.percona.com/u/aniruddha.deshpande)
#### Post date: [April 24, 2025, 9:20am UTC](https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713/1 "2025-04-24T09:20:10Z")

</div>

Hi All,

I’m currently facing a rather confusing situation.

**Issue:**

While reviewing the Query Analytics (QAN) in PMM3 (and also in PMM 2.x), we noticed that when selecting a specific time range, some queries are being displayed that we are confident did **not** run during that selected timeframe.

For example -

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/3X/8/d/8d71d80d5cc8909ce9f44f6792087c8d3db14e7c.jpeg)

In the screenshot below, we selected a 5-minute window to view the queries executed during that time. However, the marked DELETE queries appear in the list — even though we are certain these queries only run during our scheduled maintenance window around **6:30 PM**.

Environment details -  
PMM version : 3.1.0 (Same issue with older 2.4xx as well. That’s why we upgraded)  
Postgres version -PostgreSQL 16.6  
pg\_stat\_statement : 1.10

We use pg\_stat\_statement and database servers has PMM client installed. PMM client version - 3.1.0.

Also, one more question - What is load here? as i do not find clear info about it. Does it mean that the query was executed and caused that load?

We would appreciate any insights or guidance on why these queries are showing up outside of their actual execution window.

Thank you.

---

<div class="post-metadata">

### Author: ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)
#### Post date: [April 24, 2025, 1:26pm UTC](https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713/2 "2025-04-24T13:26:05Z")

</div>

Hello @aniruddha.deshpande,  
I’ll let a PMM dev chime in about the query window issue, and I’ll explain that “Load” is simply “Query Count” x “Query Time”. Take your first query as example: 9.6 queries per second \* 48.0 sec avg exec time = 460.8 load.

---

<div class="post-metadata">

### Author: ![Jiri\_Ctvrtka1](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jiri_ctvrtka1/32/10716_2.png) [@Jiri\_Ctvrtka1](https://forums.percona.com/u/Jiri_Ctvrtka1)
#### Post date: [April 24, 2025, 3:41pm UTC](https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713/3 "2025-04-24T15:41:49Z")

</div>

Hi @aniruddha.deshpande,

Could you please check if this is coming from `pg_stat_statements` itself or, for some reason, from PMM?

I think the simplest way to check is:  
If you can see the mentioned queries appearing at a 5-minute interval (and you’re sure they aren’t triggered)

1. Log in to a PG client
2. Run following query:  
SELECT \* FROM pg\_stat\_statements;

Let me know if you’re able to find such a query in the output.

Thank you.

---

<div class="post-metadata">

### Author: ![aniruddha.deshpande](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aniruddha.deshpande](https://forums.percona.com/u/aniruddha.deshpande)
#### Post date: [April 25, 2025, 6:28am UTC](https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713/4 "2025-04-25T06:28:28Z")

</div>

Hello @matthewb ,

Thank you for your quick reply and clearing the air around LOAD.

---

<div class="post-metadata">

### Author: ![aniruddha.deshpande](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aniruddha.deshpande](https://forums.percona.com/u/aniruddha.deshpande)
#### Post date: [April 25, 2025, 6:56am UTC](https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713/5 "2025-04-25T06:56:23Z")

</div>

Hello @Jiri_Ctvrtka1 ,

Thank you for your response.

If I understand you correctly, then yes — we have already verified this through pg\_stat\_statements by sampling at 1-minute intervals. During the specified time window, these queries were not executed. We also monitored over an extended period and confirmed that these queries were not executed during that time either.

---

<div class="post-metadata">

### Author: ![nurlan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/nurlan/32/1523_2.png) [@nurlan](https://forums.percona.com/u/nurlan)
#### Post date: [April 25, 2025, 9:50am UTC](https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713/6 "2025-04-25T09:50:58Z")

</div>

Hi @aniruddha.deshpande,  
Can you check how many records do you have in pg\_stat\_statements view? Is it bigger then 5000?

---

<div class="post-metadata">

### Author: ![aniruddha.deshpande](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aniruddha.deshpande](https://forums.percona.com/u/aniruddha.deshpande)
#### Post date: [April 25, 2025, 10:07am UTC](https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713/7 "2025-04-25T10:07:00Z")

</div>

Hello @nurlan ,

yes.. we do have more than 5000.

## PROD: postgres=# select count(\*) from pg\_stat\_statements; count

9490  
(1 row)

## PROD: postgres=# SELECT stats\_reset FROM pg\_stat\_statements\_info; stats\_reset

2025-04-22 14:53:34.394045+02  
(1 row)

some more info-

1. As we saw this issue, we tried resetting the pg\_stat\_statements. Thats why you see the the reset data as recent as 22.04.
2. Also I tried setting retention on PMM to 1 day to flush out old data.

This is production server so it does have lot of queries running on it.

---

<div class="post-metadata">

### Author: ![nurlan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/nurlan/32/1523_2.png) [@nurlan](https://forums.percona.com/u/nurlan)
#### Post date: [April 25, 2025, 12:52pm UTC](https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713/8 "2025-04-25T12:52:11Z")

</div>

Thank you,  
we have reported [bug](https://perconadev.atlassian.net/browse/PMM-13694) about this behavior which is planned for fix in PMM 3.2.0

---

<div class="post-metadata">

### Author: ![aniruddha.deshpande](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aniruddha.deshpande](https://forums.percona.com/u/aniruddha.deshpande)
#### Post date: [April 25, 2025, 1:32pm UTC](https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713/9 "2025-04-25T13:32:48Z")

</div>

Hello @nurlan ,

Thanks for the update! Glad to hear it’s been reported — looking forward to the fix in PMM 3.2.0.  
Appreciate the support!

---

<div class="post-metadata">

### Author: ![aniruddha.deshpande](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aniruddha.deshpande](https://forums.percona.com/u/aniruddha.deshpande)
#### Post date: [May 12, 2025, 8:13am UTC](https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713/10 "2025-05-12T08:13:48Z")

</div>

Hi @nurlan ,

Hope you are well.  
May I kindly ask if there is an approximate timeline for the release of PMM 3.2.0? It would help us plan accordingly on our end.

---

<div class="post-metadata">

### Author: ![ademidoff](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ademidoff/32/14234_2.png) [@ademidoff](https://forums.percona.com/u/ademidoff)
#### Post date: [May 12, 2025, 2:06pm UTC](https://forums.percona.com/t/qan-showing-query-which-are-not-running-during-the-time-range-selected/37713/11 "2025-05-12T14:06:44Z")

</div>

It’s approximately two weeks from now, but no commitment 🙂
