toast useless

From: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: toast useless
Date: 2022-09-13 11:45:05
Message-ID: CAB-JLwbQr60=r=9+bspE0ohDTrAKhU8wZY-oa1U4QtrykviQOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

create table test(x integer, y integer, w varchar(50), z varchar(80));
When a table has well defined sizes all their data is stored on heap, so
they doesn´t need to be toasted, and no toast table is created. Fine.

But then I want to store last modification of that record, so I do ...
alter table test add audit_last_record jsonb;
And a trigger to store old.* on that field.

So I'm sure that jsonb will fit on heap too because their size is all other
fields converted to jsonb, never bigger than that.

But as soon as I´ve created that field, a toast table is created too. Even
if I set storage MAIN to that field, reltoastrelid on pg_class still exists.

alter table test alter audit_last_record SET STORAGE MAIN

So, there is a way to eliminate these useless toast tables ?

thanks
Marcos

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2022-09-13 12:06:22 Re: toast useless
Previous Message Tom Lane 2022-09-13 05:01:16 Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?