# Incomprehensible amount!

**URL:** <https://forums.percona.com/t/incomprehensible-amount/16259>\
**Category:** PMM 2.x\
**Tags:** mysql, percona\
**Created:** [June 22, 2022, 12:19pm UTC](https://forums.percona.com/t/incomprehensible-amount/16259 "2022-06-22T12:19:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![venomania](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@venomania](https://forums.percona.com/u/venomania)\
**Post date:** [June 22, 2022, 12:19pm UTC](https://forums.percona.com/t/incomprehensible-amount/16259/1 "2022-06-22T12:19:13Z")

</div>

Hello, I have a problem with my sum in Query Analytics  
it gives me too high numbers.

Example:  
I have a query that on pmm makes a total sum of 14,36k and when I do this query

```auto
SELECT
  *
FROM
  `performance_schema`.`events_statements_summary_by_digest`
WHERE
  `DIGEST` IS NOT NULL
  AND `QUERY_SAMPLE_TEXT` IS NOT NULL

```

I see that it is made 215.

They are compared in the same period

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/0/01135d9ffdc8d66fd3d9c1d37d9ba807199da066.png)

do you know what for ?

---

<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:** [June 22, 2022, 3:05pm UTC](https://forums.percona.com/t/incomprehensible-amount/16259/2 "2022-06-22T15:05:11Z")

</div>

Hello @venomania,  
I don’t understand your question. That query is being executed by PMM to collect metrics. The query runs very frequently.

---

<div class="post-metadata">

**Author:** ![venomania](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@venomania](https://forums.percona.com/u/venomania)\
**Post date:** [June 23, 2022, 6:00am UTC](https://forums.percona.com/t/incomprehensible-amount/16259/3 "2022-06-23T06:00:30Z")

</div>

Hello,  
I noticed that when I execute this query on my side in the field count\_star I have a result that is 215 and in pmm when I look at the Query Count I have another one that is 14.36k while it should be executed at most 400 times.

I would like to know where this difference comes from ?

---

<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:** [June 23, 2022, 12:34pm UTC](https://forums.percona.com/t/incomprehensible-amount/16259/4 "2022-06-23T12:34:26Z")

</div>

Data that lives in performance\_schema is not permanent. As memory fills up, old data is purged. PMM scrapes this data frequently as to not miss when data is purged. Thus, your total in PMM is the result of collecting count\_star data over along period of time.

---

<div class="post-metadata">

**Author:** ![venomania](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@venomania](https://forums.percona.com/u/venomania)\
**Post date:** [June 23, 2022, 12:45pm UTC](https://forums.percona.com/t/incomprehensible-amount/16259/5 "2022-06-23T12:45:23Z")

</div>

yes but in the example I gave above I had the same period before the performance\_schema purge was done and I had a big difference between what the performance\_schema (215 query ) and pmm(14.36k query ).

and moreover as said before this query can’t be played more than 400 times

---

<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:** [June 23, 2022, 1:09pm UTC](https://forums.percona.com/t/incomprehensible-amount/16259/6 "2022-06-23T13:09:26Z")

</div>

If you change the period in PMM, does the ‘Sum’ column also change? If not, then PMM is showing your the Sum total of all collections and not over the period, which would be considered a bug.

---

<div class="post-metadata">

**Author:** ![venomania](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@venomania](https://forums.percona.com/u/venomania)\
**Post date:** [June 23, 2022, 1:28pm UTC](https://forums.percona.com/t/incomprehensible-amount/16259/7 "2022-06-23T13:28:46Z")

</div>

the sum changes with time but it remain too high.

example:

I put the period from 14h12 to 14h14 on 23/06/22 for a precise request and pmm says that in 3 minutes it was executed 8.02k for a time of 413.33 ms/query and or total that makes a time of 55 Minute 17 second and it is just impossible

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/a/a7273604cf4782b84081144de462421c4b4b0cae.png)  
 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/7/7475d5417303e3def849a85288deb4d6293110e8.png)

---

<div class="post-metadata">

**Author:** ![andre](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@andre](https://forums.percona.com/u/andre)\
**Post date:** [August 19, 2022, 8:10pm UTC](https://forums.percona.com/t/incomprehensible-amount/16259/8 "2022-08-19T20:10:04Z")

</div>

Hello,  
I´m having same trouble now in a new server instalation.  
Anyone have a solution or bug indication for this? Using version 2.29  
tks

---

<div class="post-metadata">

**Author:** ![venomania](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@venomania](https://forums.percona.com/u/venomania)\
**Post date:** [August 29, 2022, 6:07am UTC](https://forums.percona.com/t/incomprehensible-amount/16259/9 "2022-08-29T06:07:33Z")

</div>

Hello, I have opened a bug report

[https://jira.percona.com/browse/PMM-10609](https://jira.percona.com/browse/PMM-10609)
