Skip to content

Commit

Permalink
Add SQL for vm_cachestat
Browse files Browse the repository at this point in the history
into pgfincore 2.0.0
  • Loading branch information
c2main committed Dec 4, 2023
1 parent e604bd4 commit 8bda12d
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions pgfincore--1.3.1--2.0.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
CREATE OR REPLACE 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 OR REPLACE 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 OR REPLACE 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;

0 comments on commit 8bda12d

Please sign in to comment.