Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
pgstattuple--1.1--1.2.sql40 linesDownload Raw Back to extension
1/* contrib/pgstattuple/pgstattuple--1.1--1.2.sql */2 3-- complain if script is sourced in psql, rather than via ALTER EXTENSION4\echo Use "ALTER EXTENSION pgstattuple UPDATE TO '1.2'" to load this file. \quit5 6ALTER EXTENSION pgstattuple DROP FUNCTION pgstattuple(oid);7DROP FUNCTION pgstattuple(oid);8 9CREATE FUNCTION pgstattuple(IN reloid regclass,10    OUT table_len BIGINT,		-- physical table length in bytes11    OUT tuple_count BIGINT,		-- number of live tuples12    OUT tuple_len BIGINT,		-- total tuples length in bytes13    OUT tuple_percent FLOAT8,		-- live tuples in %14    OUT dead_tuple_count BIGINT,	-- number of dead tuples15    OUT dead_tuple_len BIGINT,		-- total dead tuples length in bytes16    OUT dead_tuple_percent FLOAT8,	-- dead tuples in %17    OUT free_space BIGINT,		-- free space in bytes18    OUT free_percent FLOAT8)		-- free space in %19AS 'MODULE_PATHNAME', 'pgstattuplebyid'20LANGUAGE C STRICT;21 22CREATE 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)33AS 'MODULE_PATHNAME', 'pgstatindexbyid'34LANGUAGE C STRICT;35 36CREATE FUNCTION pg_relpages(IN relname regclass)37RETURNS BIGINT38AS 'MODULE_PATHNAME', 'pg_relpagesbyid'39LANGUAGE C STRICT;40 
codekingpro/portable-devtools · Team Ai