pg_stat_wal: tracking the compression effect

From: Ken Kato <katouknl(at)oss(dot)nttdata(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: pg_stat_wal: tracking the compression effect
Date: 2022-08-25 07:04:50
Message-ID: 0489c74a83dbd54ed33feb6690d7ca4f@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hi hackers,

We can specify compression method (for example, lz4, zstd), but it is
hard to know the effect of compression depending on the method. There is
already a way to know the compression effect using pg_waldump. However,
having these statistics in the view makes it more accessible. I am
proposing to add statistics, which keeps track of compression effect in
pg_stat_ wal view.

The design I am thinking is below:

compression_saved | compression_times
------------------+-------------------
38741 | 6

Accumulating the values, which indicates how much space is saved by each
compression (size before compression - size after compression), and keep
track of how many times compression has happened. So that one can know
how much space is saved on average.

What do you think?

Regards,

--
Ken Kato
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2022-08-25 07:49:17 Re: pg_rewind WAL segments deletion pitfall
Previous Message John Naylor 2022-08-25 06:35:45 Re: [PATCH] Optimize json_lex_string by batching character copying