TOAST table created for partitioned tables

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: TOAST table created for partitioned tables
Date: 2018-01-16 10:13:41
Message-ID: b4c9dee6-d134-49b8-79c4-07fbd7c3b898@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
v1-0001-Do-not-create-TOAST-table-for-partitioned-tables.patch text/plain 1.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Giuseppe Broccolo 2018-01-16 10:17:51 Re: Setting BLCKSZ 4kB
Previous Message Yuto Hayamizu 2018-01-16 09:45:22 Re: [HACKERS] [PATCH] Overestimated filter cost and its mitigation