From e9cf6e685beacdf24f6873d597a5c78ff9beb679 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Tue, 27 Dec 2016 11:23:46 -0500 Subject: [PATCH] Explain unaccounted for space in pgstattuple. In addition to space accounted for by tuple_len, dead_tuple_len and free_space, the table_len includes page overhead, the item pointers table and padding bytes. Backpatch to live branches. --- doc/src/sgml/pgstattuple.sgml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/src/sgml/pgstattuple.sgml b/doc/src/sgml/pgstattuple.sgml index 61340bedbc..4a220992ce 100644 --- a/doc/src/sgml/pgstattuple.sgml +++ b/doc/src/sgml/pgstattuple.sgml @@ -109,6 +109,16 @@ free_percent | 1.95 + + + The table_len will always be greater than the sum + of the tuple_len, dead_tuple_len + and free_space. The difference is accounted for by + fixed page overhead, the per-page table of pointers to tuples, and + padding to ensure that tuples are correctly aligned. + + + pgstattuple acquires only a read lock on the relation. So the results do not reflect an instantaneous snapshot;