RE: [PATCH] pg_stat_toast

From: "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: "'Gunnar \"Nick\" Bluth'" <gunnar(dot)bluth(at)pro-open(dot)de>, "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 03:20:55
Message-ID: TYAPR01MB5866AD5BFFE87634E798714BF57B9@TYAPR01MB5866.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Gunnar,

> 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?

Best Regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message tanghy.fnst@fujitsu.com 2021-12-20 03:23:41 RE: row filtering for logical replication
Previous Message houzj.fnst@fujitsu.com 2021-12-20 03:10:58 RE: row filtering for logical replication