TOAST table created for partitioned tables - Mailing list pgsql-hackers

From Amit Langote
Subject TOAST table created for partitioned tables
Date
Msg-id b4c9dee6-d134-49b8-79c4-07fbd7c3b898@lab.ntt.co.jp
Whole thread Raw
Responses Re: TOAST table created for partitioned tables
List pgsql-hackers
Hi.

I used to think that $subject didn't happen, but it actually does and ends
up consuming a fixed 8192 bytes on the disk.

create table p (a int[]) partition by list (a);
CREATE TABLE

select pg_table_size('p');
 pg_table_size
---------------
          8192
(1 row)

select  pg_relation_size(c1.oid) as p_size,
        pg_relation_size(c1.reltoastrelid) as p_toast_heap_size,
        pg_relation_size(c2.oid) as p_toast_index_size
from    pg_class c1, pg_class c2, pg_index i
where   c1.relname = 'p' and
        c1.reltoastrelid = i.indrelid and
        c2.oid = i.indexrelid;
 p_size | p_toast_heap_size | p_toast_index_size
--------+-------------------+--------------------
      0 |                 0 |               8192
(1 row)

I think we should prevent this, a fix for which is implemented by the
attached patch.

Thanks,
Amit

Attachment

pgsql-hackers by date:

Previous
From: Yuto Hayamizu
Date:
Subject: Re: [HACKERS] [PATCH] Overestimated filter cost and its mitigation
Next
From: Giuseppe Broccolo
Date:
Subject: Re: Setting BLCKSZ 4kB