1 pgstattuple README 2001/10/01 Tatsuo Ishii
3 1. What is pgstattuple?
5 pgstattuple returns the percentage of the "dead" tuples of a
6 table. This will help users to judge if vacuum is needed.
8 In addition, pgstattuple prints more detailed information using
11 test=# select pgstattuple('tellers');
12 NOTICE: physical length: 0.08MB live tuples: 20 (0.00MB, 1.17%) dead tuples: 320 (0.01MB, 18.75%) free/reusable space: 0.01MB (18.06%) overhead: 62.02%
18 Above example shows tellers table includes 18.75% dead tuples.
20 physical length physical size of the table in MB
21 live tuples information on the live tuples
22 dead tuples information on the dead tuples
23 free/reusable space available space
24 overhead overhead space
26 2. Installing pgstattuple
30 $ psql -e -f /usr/local/pgsql/share/contrib/pgstattuple.sql test
34 pgstattuple can be called as a function:
36 pgstattuple(TEXT) RETURNS FLOAT8
38 The argument is the table name. pgstattuple returns the percentage
39 of the "dead" tuples of a table.
43 pgstattuple acquires only a read lock on the table. So concurrent
44 update may affect the result.
46 pgstattuple judges a tuple is "dead" if HeapTupleSatisfiesNow()