pg_freespacemap.sql

来自「PostgreSQL 8.2中增加了很多企业用户所需要的功能和性能上的提高,其开」· SQL 代码 · 共 46 行

SQL
46
字号
-- Adjust this setting to control where the objects get created.BEGIN;SET search_path = public;-- Register the functions.CREATE OR REPLACE FUNCTION pg_freespacemap_pages()RETURNS SETOF RECORDAS '$libdir/pg_freespacemap', 'pg_freespacemap_pages'LANGUAGE C;CREATE OR REPLACE FUNCTION pg_freespacemap_relations()RETURNS SETOF RECORDAS '$libdir/pg_freespacemap', 'pg_freespacemap_relations'LANGUAGE C;-- Create views for convenient access.CREATE VIEW pg_freespacemap_pages AS	SELECT P.* FROM pg_freespacemap_pages() AS P	(reltablespace oid,	 reldatabase oid,	 relfilenode oid,	 relblocknumber bigint,	 bytes integer); CREATE VIEW pg_freespacemap_relations AS	SELECT P.* FROM pg_freespacemap_relations() AS P	(reltablespace oid,	 reldatabase oid,	 relfilenode oid,	 avgrequest integer,	 interestingpages integer,	 storedpages integer,	 nextpage integer); -- Don't want these to be available to public.REVOKE ALL ON FUNCTION pg_freespacemap_pages() FROM PUBLIC;REVOKE ALL ON pg_freespacemap_pages FROM PUBLIC;REVOKE ALL ON FUNCTION pg_freespacemap_relations() FROM PUBLIC;REVOKE ALL ON pg_freespacemap_relations FROM PUBLIC;COMMIT;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?