1 /* contrib/pgstattuple/pgstattuple--1.0.sql */
3 CREATE FUNCTION pgstattuple(IN relname text,
4 OUT table_len BIGINT, -- physical table length in bytes
5 OUT tuple_count BIGINT, -- number of live tuples
6 OUT tuple_len BIGINT, -- total tuples length in bytes
7 OUT tuple_percent FLOAT8, -- live tuples in %
8 OUT dead_tuple_count BIGINT, -- number of dead tuples
9 OUT dead_tuple_len BIGINT, -- total dead tuples length in bytes
10 OUT dead_tuple_percent FLOAT8, -- dead tuples in %
11 OUT free_space BIGINT, -- free space in bytes
12 OUT free_percent FLOAT8) -- free space in %
13 AS 'MODULE_PATHNAME', 'pgstattuple'
16 CREATE FUNCTION pgstattuple(IN reloid oid,
17 OUT table_len BIGINT, -- physical table length in bytes
18 OUT tuple_count BIGINT, -- number of live tuples
19 OUT tuple_len BIGINT, -- total tuples length in bytes
20 OUT tuple_percent FLOAT8, -- live tuples in %
21 OUT dead_tuple_count BIGINT, -- number of dead tuples
22 OUT dead_tuple_len BIGINT, -- total dead tuples length in bytes
23 OUT dead_tuple_percent FLOAT8, -- dead tuples in %
24 OUT free_space BIGINT, -- free space in bytes
25 OUT free_percent FLOAT8) -- free space in %
26 AS 'MODULE_PATHNAME', 'pgstattuplebyid'
29 CREATE FUNCTION pgstatindex(IN relname text,
32 OUT index_size BIGINT,
33 OUT root_block_no BIGINT,
34 OUT internal_pages BIGINT,
35 OUT leaf_pages BIGINT,
36 OUT empty_pages BIGINT,
37 OUT deleted_pages BIGINT,
38 OUT avg_leaf_density FLOAT8,
39 OUT leaf_fragmentation FLOAT8)
40 AS 'MODULE_PATHNAME', 'pgstatindex'
43 CREATE FUNCTION pg_relpages(IN relname text)
45 AS 'MODULE_PATHNAME', 'pg_relpages'