Skip to content

Commit fa29b93

Browse files
committed
Update file 0006_pg_stat_statements_part_2.md
1 parent ddb64c8 commit fa29b93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

0006_pg_stat_statements_part_2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Let's consider the meanings of various derived metrics obtained in such way:
3333

3434
4. `dM/dc`, where `M` is `shared_blks_hit + shared_blks_read` – average number of "hits + reads" from the buffer pool. It is worth translating this to bytes: for example, `500,000` buffer hits&reads translates to `500000 GiB * 8 / 1024 / 1024 = ~ 3.8 GiB`, this is a significant number for a single query, especially if its goal is to return just a row or a few. Large numbers here should be considered as a strong call for query optimization. Additional notes:
3535
- in many cases, it makes sense to have hits and reads can be also considered separately – there may be the cases when, for example, queries in some pgss group do not lead to high disk IO and reading from the page cache, but they have so many hits in the buffer pool, so their performance is suboptimal, even with all the data being cached in the buffer pool
36-
- to have real disk IO numbers, it is worth using https://github.com/powa-team/pg_stat_kcache
36+
- to have real disk IO numbers, it is worth using [pg_stat_kcache](https://github.com/powa-team/pg_stat_kcache)
3737
- a sudden change in the values of this metric for a particular group that persists over time, can be a sign of plan flip and needs to be studied
3838
- high-level aggregated values are also interesting to observe, answering questions like "how many MiB do all queries, on average, read on this server?"
3939

0 commit comments

Comments
 (0)