Re: TOAST - why separate visibility map

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Virender Singla <virender.cse@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-11-19T20:31:00Z
Lists: pgsql-hackers
Virender Singla <virender.cse@gmail.com> writes:
> Why do Toast tables have it's own visibility map and xmin, xmax columns etc?
> Isn't it increasing row size in a toast table and adding more complexity?

There are advantages to having the same low-level format for toast tables
as regular tables --- for example, that you can look into a toast table
for debugging purposes with normal SQL queries.  Even if we weren't tied
to that format for disk-storage-compatibility reasons, I'd be disinclined
to change it.

It might be feasible to drop the visibility map for toast tables, though.
I agree that's not buying much, since ordinary queries don't consult it.
Not sure if there'd be a win proportional to the added code complexity.

			regards, tom lane