Re: [PATCH] pg_stat_toast

From: "Gunnar \"Nick\" Bluth" <gunnar(dot)bluth(at)pro-open(dot)de>
To: "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: "gkokolatos(at)protonmail(dot)com" <gkokolatos(at)protonmail(dot)com>
Subject: Re: [PATCH] pg_stat_toast
Date: 2021-12-20 08:43:44
Message-ID: b933a680-a6bd-9cf5-920f-1305fbf0423d@pro-open.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Am 20.12.2021 um 04:20 schrieb kuroda(dot)hayato(at)fujitsu(dot)com:
> Dear Gunnar,

Hi Kuroda-San!

>> postgres=# CREATE TABLE test (i int, lz4 text COMPRESSION lz4, std text);
>> postgres=# INSERT INTO test SELECT
>> i,repeat(md5(i::text),100),repeat(md5(i::text),100) FROM
>> generate_series(0,100000) x(i);
>> postgres=# SELECT * FROM pg_stat_toast WHERE schemaname = 'public';
>> -[ RECORD 1 ]--------+----------
>> schemaname | public
>> reloid | 16829
>> attnum | 2
>> relname | test
>> attname | lz4
>> externalizations | 0
>> compressions | 100001
>> compressionsuccesses | 100001
>> compressionsizesum | 6299710
>> originalsizesum | 320403204
>> -[ RECORD 2 ]--------+----------
>> schemaname | public
>> reloid | 16829
>> attnum | 3
>> relname | test
>> attname | std
>> externalizations | 0
>> compressions | 100001
>> compressionsuccesses | 100001
>> compressionsizesum | 8198819
>> originalsizesum | 320403204
>
> I'm not sure about TOAST, but currently compressions are configurable:
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=bbe0a81db69bd10bd166907c3701492a29aca294
>
> How about adding a new attribute "method" to pg_stat_toast?
> ToastAttrInfo *attr->tai_compression represents how compress the data,
> so I think it's easy to add.
> Or, is it not needed because pg_attr has information?

That information could certainly be included in the view, grabbing the
information from pg_attribute.attcompression. It probably should!

I guess the next step will be to include that view in the catalog
anyway, so I'll do that next.

Thx for the feedback!
--
Gunnar "Nick" Bluth

Eimermacherweg 106
D-48159 Münster

Mobil +49 172 8853339
Email: gunnar(dot)bluth(at)pro-open(dot)de
__________________________________________________________________________
"Ceterum censeo SystemD esse delendam" - Cato

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message tanghy.fnst@fujitsu.com 2021-12-20 08:46:44 RE: row filtering for logical replication
Previous Message Kyotaro Horiguchi 2021-12-20 08:39:27 Re: In-placre persistance change of a relation