pg_stat_wal: tracking the compression effect - Mailing list pgsql-hackers

From Ken Kato
Subject pg_stat_wal: tracking the compression effect
Date
Msg-id 0489c74a83dbd54ed33feb6690d7ca4f@oss.nttdata.com
Whole thread Raw
Responses Re: pg_stat_wal: tracking the compression effect
Re: pg_stat_wal: tracking the compression effect
List 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



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: [PATCH] Optimize json_lex_string by batching character copying
Next
From: Dong Wook Lee
Date:
Subject: Re: pg_basebackup: add test about zstd compress option