# P95 query latencies for read and write

**URL:** <https://forums.percona.com/t/p95-query-latencies-for-read-and-write/25928>\
**Category:** PMM 2.x\
**Created:** [October 16, 2023, 7:46am UTC](https://forums.percona.com/t/p95-query-latencies-for-read-and-write/25928 "2023-10-16T07:46:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Animesh\_Agarwal](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/animesh_agarwal/32/9369_2.png) [@Animesh\_Agarwal](https://forums.percona.com/u/Animesh_Agarwal)\
**Post date:** [October 16, 2023, 7:46am UTC](https://forums.percona.com/t/p95-query-latencies-for-read-and-write/25928/1 "2023-10-16T07:46:11Z")

</div>

Hi Team,  
We would like to understand the query latencies separately for read and write queries. Is there any metric in PMM which distinguishes the read/write latency ?

---

<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:** [October 16, 2023, 2:39pm UTC](https://forums.percona.com/t/p95-query-latencies-for-read-and-write/25928/2 "2023-10-16T14:39:56Z")

</div>

In the QAN section of PMM, you can see the metrics for each query. Is this not what you need?

---

<div class="post-metadata">

**Author:** ![Animesh\_Agarwal](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/animesh_agarwal/32/9369_2.png) [@Animesh\_Agarwal](https://forums.percona.com/u/Animesh_Agarwal)\
**Post date:** [October 17, 2023, 4:33am UTC](https://forums.percona.com/t/p95-query-latencies-for-read-and-write/25928/3 "2023-10-17T04:33:47Z")

</div>

Hi @matthewb  
Thanks for your reply.

We wish to see not the individual query latency, but overall average latencies separately for read and write over a period of time.

---

<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:** [October 17, 2023, 3:26pm UTC](https://forums.percona.com/t/p95-query-latencies-for-read-and-write/25928/4 "2023-10-17T15:26:13Z")

</div>

Hello @Animesh_Agarwal,  
I don’t believe that is possible. MySQL doesn’t track those metrics, PMM aggregates the data from individual queries. There was a plugin for MySQL 5.7 that tracked this data, but the plugin doesn’t work in MySQL 8.

---

<div class="post-metadata">

**Author:** ![Animesh\_Agarwal](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/animesh_agarwal/32/9369_2.png) [@Animesh\_Agarwal](https://forums.percona.com/u/Animesh_Agarwal)\
**Post date:** [October 17, 2023, 6:49pm UTC](https://forums.percona.com/t/p95-query-latencies-for-read-and-write/25928/5 "2023-10-17T18:49:39Z")

</div>

Hi @matthewb

Wanted to get your opinion on the below:  
Since PMM tracks the query latency for individual metrics, is it not possible to identify the type of query - read/write and store that in ClickHouse ? Once we have the data in clickhouse, we can run aggregations on top of the raw data.

---

<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:** [October 17, 2023, 8:40pm UTC](https://forums.percona.com/t/p95-query-latencies-for-read-and-write/25928/6 "2023-10-17T20:40:11Z")

</div>

You are free to do whatever you want with the data collected by PMM. As it stands now, PMM doesn’t support a graphical option to view the data you want. PMM is 100% open source so you are fee to modify it and contribute back to our repo for others to enjoy.
