mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-23 18:57:19 +02:00
54 lines
1.3 KiB
MySQL
54 lines
1.3 KiB
MySQL
-- Adjust this setting to control where the objects get created.
|
|
SET search_path = public;
|
|
|
|
CREATE TYPE pgstattuple_type AS (
|
|
table_len BIGINT, -- physical table length in bytes
|
|
tuple_count BIGINT, -- number of live tuples
|
|
tuple_len BIGINT, -- total tuples length in bytes
|
|
tuple_percent FLOAT, -- live tuples in %
|
|
dead_tuple_count BIGINT, -- number of dead tuples
|
|
dead_tuple_len BIGINT, -- total dead tuples length in bytes
|
|
dead_tuple_percent FLOAT, -- dead tuples in %
|
|
free_space BIGINT, -- free space in bytes
|
|
free_percent FLOAT -- free space in %
|
|
);
|
|
|
|
CREATE OR REPLACE FUNCTION pgstattuple(text)
|
|
RETURNS pgstattuple_type
|
|
AS 'MODULE_PATHNAME', 'pgstattuple'
|
|
LANGUAGE C STRICT;
|
|
|
|
CREATE OR REPLACE FUNCTION pgstattuple(oid)
|
|
RETURNS pgstattuple_type
|
|
AS 'MODULE_PATHNAME', 'pgstattuplebyid'
|
|
LANGUAGE C STRICT;
|
|
|
|
--
|
|
-- pgstatindex
|
|
--
|
|
CREATE TYPE pgstatindex_type AS (
|
|
version int4,
|
|
tree_level int4,
|
|
index_size int4,
|
|
root_block_no int4,
|
|
internal_pages int4,
|
|
leaf_pages int4,
|
|
empty_pages int4,
|
|
deleted_pages int4,
|
|
avg_leaf_density float8,
|
|
leaf_fragmentation float8
|
|
);
|
|
|
|
CREATE OR REPLACE FUNCTION pgstatindex(text)
|
|
RETURNS pgstatindex_type
|
|
AS 'MODULE_PATHNAME', 'pgstatindex'
|
|
LANGUAGE 'C' STRICT;
|
|
|
|
--
|
|
-- pg_relpages()
|
|
--
|
|
CREATE OR REPLACE FUNCTION pg_relpages(text)
|
|
RETURNS int
|
|
AS 'MODULE_PATHNAME', 'pg_relpages'
|
|
LANGUAGE 'C' STRICT;
|