Debian Codegraph @

contrib/pgstattuple/pgstattuple--1.1--1.2.sql

raw
1 /* contrib/pgstattuple/pgstattuple--1.1--1.2.sql */
2
3 -- complain if script is sourced in psql, rather than via ALTER EXTENSION
4 \echo Use "ALTER EXTENSION pgstattuple UPDATE TO '1.2'" to load this file. \quit
5
6 ALTER EXTENSION pgstattuple DROP FUNCTION pgstattuple(oid);
7 DROP FUNCTION pgstattuple(oid);
8
9 CREATE FUNCTION pgstattuple(IN reloid regclass,
10 OUT table_len BIGINT, -- physical table length in bytes
11 OUT tuple_count BIGINT, -- number of live tuples
12 OUT tuple_len BIGINT, -- total tuples length in bytes
13 OUT tuple_percent FLOAT8, -- live tuples in %
14 OUT dead_tuple_count BIGINT, -- number of dead tuples
15 OUT dead_tuple_len BIGINT, -- total dead tuples length in bytes
16 OUT dead_tuple_percent FLOAT8, -- dead tuples in %
17 OUT free_space BIGINT, -- free space in bytes
18 OUT free_percent FLOAT8) -- free space in %
19 AS 'MODULE_PATHNAME', 'pgstattuplebyid'
20 LANGUAGE C STRICT;
21
22 CREATE FUNCTION pgstatindex(IN relname regclass,
23 OUT version INT,
24 OUT tree_level INT,
25 OUT index_size BIGINT,
26 OUT root_block_no BIGINT,
27 OUT internal_pages BIGINT,
28 OUT leaf_pages BIGINT,
29 OUT empty_pages BIGINT,
30 OUT deleted_pages BIGINT,
31 OUT avg_leaf_density FLOAT8,
32 OUT leaf_fragmentation FLOAT8)
33 AS 'MODULE_PATHNAME', 'pgstatindexbyid'
34 LANGUAGE C STRICT;
35
36 CREATE FUNCTION pg_relpages(IN relname regclass)
37 RETURNS BIGINT
38 AS 'MODULE_PATHNAME', 'pg_relpagesbyid'
39 LANGUAGE C STRICT;