From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: hus.mhd@gmail.com
Subject: TOAST pointer size
Date: Fri, 04 Dec 2020 23:46:25 +0000
Message-ID: <160712558528.686.9567660182316195384@wrigleys.postgresql.org> (raw)
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/13/storage-toast.html
Description:
Hey team,
It would be nice to add a break-down of why the TOAST Pointer size is 18
bytes
quoting here
```A pointer datum representing an out-of-line on-disk TOASTed value
therefore needs to store the OID of the TOAST table in which to look and the
OID of the specific value (its chunk_id). For convenience, pointer datums
also store the logical datum size (original uncompressed data length) and
physical stored size (different if compression was applied). Allowing for
the varlena header bytes, the total size of an on-disk TOAST pointer datum
is therefore 18 bytes regardless of the actual size of the represented
value.
```
Assuming OID is a 4 bytes unsigned, So 4 bytes for the TOAST Table OID + 4
bytes for the Chunk Id (OID) + how many bytes for the physical stored size+
how many bytes for the logical datum size + 4 bytes for the verlena header
bytes ? Searched every where but couldn't find an answer how that adds up to
18 bytes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, hus.mhd@gmail.com
Subject: Re: TOAST pointer size
In-Reply-To: <160712558528.686.9567660182316195384@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox