Re: Use pgBufferUsage for block reporting in analyze

Поиск
Список
Период
Сортировка
От Anthonin Bonnefoy
Тема Re: Use pgBufferUsage for block reporting in analyze
Дата
Msg-id CAO6_XqqBhMYSNQYR54oMJf5m_vm=yP-SQwO_0Rx0aGsh7=U0Jg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Use pgBufferUsage for block reporting in analyze  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Thanks for having a look.

On Fri, May 10, 2024 at 12:40 PM Michael Paquier <michael@paquier.xyz> wrote:
This needs some runtime check to make sure that the calculations 
are consistent before and after the fact (cannot do that now).
Yeah, testing this is also a bit painful as buffer usage of analyze is only displayed in the logs during autoanalyze. While looking at this, I've thought of additional changes that could make testing easier and improve consistency with VACUUM VERBOSE:
- Have ANALYZE VERBOSE outputs the buffer usage stats
- Add Wal usage to ANALYZE VERBOSE

analyze verbose output would look like: 
postgres=# analyze (verbose) pgbench_accounts ;
INFO:  analyzing "public.pgbench_accounts"
INFO:  "pgbench_accounts": scanned 1640 of 1640 pages, containing 100000 live rows and 0 dead rows; 30000 rows in sample, 100000 estimated total rows
INFO:  analyze of table "postgres.public.pgbench_accounts"
avg read rate: 124.120 MB/s, avg write rate: 0.110 MB/s
buffer usage: 533 hits, 1128 reads, 1 dirtied
WAL usage: 12 records, 1 full page images, 5729 bytes
system usage: CPU: user: 0.06 s, system: 0.00 s, elapsed: 0.07 s 

Perhaps this should say "read" rather than "miss" in the logs as the
two read variables for the shared and local blocks are used?  For
consistency, at least.
Sounds good. 

That's not material for v17, only for v18.
 Definitely

I've split the patch in two parts
1: Removal of the vacuum specific variables, this is the same as the initial patch.
2: Add buffer and wal usage to analyze verbose output + rename miss to reads 

Regards,
Anthonin
Вложения

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

Предыдущее
От: Markus Winand
Дата:
Сообщение: ON ERROR in json_query and the like
Следующее
От: Nisha Moond
Дата:
Сообщение: Re: Conflict Detection and Resolution