pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedTOAST pointer size
2+ messages / 2 participants
[nested] [flat]
* TOAST pointer size
@ 2020-12-04 23:46 PG Doc comments form <noreply@postgresql.org>
0 siblings, 1 reply; 2+ messages in thread
From: PG Doc comments form @ 2020-12-04 23:46 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: hus.mhd@gmail.com
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: TOAST pointer size
@ 2020-12-05 18:09 Tom Lane <tgl@sss.pgh.pa.us>
parent: PG Doc comments form <noreply@postgresql.org>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2020-12-05 18:09 UTC (permalink / raw)
To: hus.mhd@gmail.com; +Cc: pgsql-docs@lists.postgresql.org
PG Doc comments form <noreply@postgresql.org> writes:
> It would be nice to add a break-down of why the TOAST Pointer size is 18
> bytes
Use the source, Luke. The useful pointer data is indeed 16 bytes:
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/postgres.h;h=c48f47e930ad05...
but there's varlena tag overhead:
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/postgres.h;h=c48f47e930ad05...
This doesn't seem like appropriate detail for the user docs.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-12-05 18:09 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 23:46 TOAST pointer size PG Doc comments form <noreply@postgresql.org>
2020-12-05 18:09 ` Tom Lane <tgl@sss.pgh.pa.us>
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