Explain unaccounted for space in pgstattuple.
authorAndrew Dunstan <andrew@dunslane.net>
Tue, 27 Dec 2016 16:23:46 +0000 (11:23 -0500)
committerAndrew Dunstan <andrew@dunslane.net>
Tue, 27 Dec 2016 16:28:23 +0000 (11:28 -0500)
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

index 7f1ae8d304868fb981e3f3ee8d68e2a08aaf1079..acd218539678169bac1096296c67a39a68577ed8 100644 (file)
@@ -106,6 +106,16 @@ free_percent       | 1.95
      </tgroup>
     </table>
 
+    <note>
+      <para>
+        The <literal>table_len</literal> will always be greater than the sum
+        of the <literal>tuple_len</literal>, <literal>dead_tuple_len</literal>
+        and <literal>free_space</literal>. 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. 
+      </para>
+    </note>
+
     <para>
      <function>pgstattuple</function> acquires only a read lock on the
      relation. So the results do not reflect an instantaneous snapshot;