diff --git a/pgfincore--1.3.1--2.0.0.sql b/pgfincore--1.3.1--2.0.0.sql index e69de29..c4e7ebc 100644 --- a/pgfincore--1.3.1--2.0.0.sql +++ b/pgfincore--1.3.1--2.0.0.sql @@ -0,0 +1,53 @@ +CREATE FUNCTION +vm_cachestat( + IN relation regclass +, IN fork_name text +, IN block_num bigint +, IN nblocks bigint +, OUT vm_pagesize bigint +, OUT nr_cache bigint +, OUT nr_dirty bigint +, OUT nr_writeback bigint +, OUT nr_evicted bigint +, OUT nr_recently_evicted bigint +, OUT pg_pagesize bigint +) +RETURNS record +AS '$libdir/pgfincore' +LANGUAGE C; + +CREATE FUNCTION +vm_cachestat( + IN relation regclass +, IN block_num bigint +, IN nblocks bigint +, OUT vm_pagesize bigint +, OUT nr_cache bigint +, OUT nr_dirty bigint +, OUT nr_writeback bigint +, OUT nr_evicted bigint +, OUT nr_recently_evicted bigint +, OUT pg_pagesize bigint +) +RETURNS record +AS $vm_cachestat$ +SELECT * FROM vm_cachestat($1,'main',$2,$3) +$vm_cachestat$ +LANGUAGE SQL; + +CREATE FUNCTION +vm_cachestat( + IN relation regclass +, OUT vm_pagesize bigint +, OUT nr_cache bigint +, OUT nr_dirty bigint +, OUT nr_writeback bigint +, OUT nr_evicted bigint +, OUT nr_recently_evicted bigint +, OUT pg_pagesize bigint +) +RETURNS record +AS $vm_cachestat$ +SELECT * FROM vm_cachestat($1,'main',NULL,NULL) +$vm_cachestat$ +LANGUAGE SQL; diff --git a/pgfincore--2.0.0.sql b/pgfincore--2.0.0.sql index 3e4643c..b1e0f6a 100644 --- a/pgfincore--2.0.0.sql +++ b/pgfincore--2.0.0.sql @@ -191,3 +191,60 @@ LANGUAGE C; COMMENT ON FUNCTION pgfincore_drawer(varbit) IS 'A naive drawing function to visualize page cache per object'; + +/* + * New functions + */ +CREATE FUNCTION +vm_cachestat( + IN relation regclass +, IN fork_name text +, IN block_num bigint +, IN nblocks bigint +, OUT vm_pagesize bigint +, OUT nr_cache bigint +, OUT nr_dirty bigint +, OUT nr_writeback bigint +, OUT nr_evicted bigint +, OUT nr_recently_evicted bigint +, OUT pg_pagesize bigint +) +RETURNS record +AS '$libdir/pgfincore' +LANGUAGE C; + +CREATE FUNCTION +vm_cachestat( + IN relation regclass +, IN block_num bigint +, IN nblocks bigint +, OUT vm_pagesize bigint +, OUT nr_cache bigint +, OUT nr_dirty bigint +, OUT nr_writeback bigint +, OUT nr_evicted bigint +, OUT nr_recently_evicted bigint +, OUT pg_pagesize bigint +) +RETURNS record +AS $vm_cachestat$ +SELECT * FROM vm_cachestat($1,'main',$2,$3) +$vm_cachestat$ +LANGUAGE SQL; + +CREATE FUNCTION +vm_cachestat( + IN relation regclass +, OUT vm_pagesize bigint +, OUT nr_cache bigint +, OUT nr_dirty bigint +, OUT nr_writeback bigint +, OUT nr_evicted bigint +, OUT nr_recently_evicted bigint +, OUT pg_pagesize bigint +) +RETURNS record +AS $vm_cachestat$ +SELECT * FROM vm_cachestat($1,'main',NULL,NULL) +$vm_cachestat$ +LANGUAGE SQL;