Re: Use pgBufferUsage for block reporting in analyze

Поиск
Список
Период
Сортировка
От Anthonin Bonnefoy
Тема Re: Use pgBufferUsage for block reporting in analyze
Дата
Msg-id CAO6_XqrdfDen3EivTRHQjeijcog9qkoFpr2g28+jZcv7Cxf9EA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Use pgBufferUsage for block reporting in analyze  (Karina Litskevich <litskevichkarina@gmail.com>)
Список pgsql-hackers
Hi,

Thanks for the review, I've updated the patches with the suggestions:
- moved renaming of misses to reads to the first patch
- added intermediate variables for total blks usage

I've also done some additional tests using the provided
vacuum_analyze_buffer_usage.sql script. It relies on
pg_stat_statements to check the results (only pgss gives information
on dirtied buffers). It gives the following output:

 psql:vacuum_analyze_buffer_usage.sql:21: INFO:  vacuuming
"postgres.pg_temp_7.vacuum_blks_stat_test"
 ...
 buffer usage: 105 hits, 3 reads, 6 dirtied
 ...
              query  | sum_hit | sum_read | sum_dirtied
 --------------------+---------+----------+-------------
  VACUUM (VERBOSE... |     105 |        3 |           6

For vacuum, we have the same results with SKIP_DATABASE_STATS. Without
this setting, we would have block usage generated by
vac_update_datfrozenxid outside of vacuum_rel and therefore not
tracked by the verbose output. For the second test, the second patch
is needed to have ANALYZE (VERBOSE) output the block usage. It will
output the following:

 psql:vacuum_analyze_buffer_usage.sql:29: INFO:  analyzing
"pg_temp_7.vacuum_blks_stat_test"
 ...
 buffer usage: 84 hits, 33 reads, 2 dirtied
 ...
     query            | sum_hit | sum_read | sum_dirtied
 ---------------------+---------+----------+-------------
  ANALYZE (VERBOSE... |      91 |       38 |           2

There's additional buffer hits/reads reported by pgss, those are from
analyze_rel opening the relations in try_relation_open and are not
tracked by the ANALYZE VERBOSE.

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Aleksander Alekseev
Дата:
Сообщение: Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Interrupts vs signals