Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
pginfo.php File Reference

Go to the source code of this file.

Variables

const PG_PAGE_SIZE 8 * 1024
 
 $pgservice_core = getServiceCore()
 
 $conn = pg_connect("service='$pgservice_core'")
 
if($conn===false$query = array()
 
 $query ['pg_settings'] = sprintf("SELECT name, setting, context, short_desc FROM pg_settings")
 
 $query ['pg_stat_activity'] = sprintf("SELECT datname, procpid, client_addr, client_port, waiting, query_start, now() - query_start AS time, current_query FROM pg_stat_activity WHERE procpid != pg_backend_pid()")
 
 $query ['tables'] = sprintf("SELECT s.schemaname, s.relname, c.oid, c.relfilenode, s.seq_scan, s.idx_scan, c.reltuples, c.relpages as pages FROM pg_stat_all_tables as s, pg_class as c WHERE s.relname = c.relname AND s.schemaname IN (SELECT nspname FROM pg_namespace WHERE oid = c.relnamespace) AND ( s.schemaname = 'public' OR s.schemaname = 'pg_toast' )")
 
 $query ['tables I/O'] = sprintf("SELECT schemaname, relname, heap_blks_read, heap_blks_hit, idx_blks_read, idx_blks_hit, toast_blks_read, toast_blks_hit, tidx_blks_read, tidx_blks_hit FROM pg_statio_all_tables WHERE schemaname IN ('public', 'pg_toast')")
 
 $query ['indexes'] = sprintf("SELECT s.schemaname, s.relname, s.indexrelname, c.oid, c.relfilenode, s.idx_scan, s.idx_tup_read, s.idx_tup_fetch, c.reltuples, c.relpages as pages FROM pg_stat_all_indexes as s, pg_class as c WHERE s.indexrelname = c.relname AND s.schemaname IN (SELECT nspname FROM pg_namespace WHERE oid = c.relnamespace) AND ( s.schemaname = 'public' OR s.schemaname = 'pg_toast' )")
 
 $query ['indexes I/O'] = sprintf("SELECT schemaname, relname, indexrelname, idx_blks_read, idx_blks_hit FROM pg_statio_all_indexes WHERE schemaname IN ('public', 'pg_toast')")
 
 $query ['vacuums'] = sprintf("SELECT s.schemaname, s.relname, c.reltuples, s.n_tup_ins, s.n_tup_upd, s.n_tup_del, s.n_tup_hot_upd, s.n_live_tup, s.n_dead_tup, s.last_vacuum, s.last_autovacuum FROM pg_stat_all_tables as s, pg_class as c WHERE s.relname = c.relname AND s.schemaname IN (SELECT nspname FROM pg_namespace WHERE oid = c.relnamespace) AND ( s.schemaname = 'public' OR s.schemaname = 'pg_toast' )")
 
 $query ['pg_buffercache'] = sprintf("SELECT c.relname, count(*) AS pages FROM pg_buffercache b INNER JOIN pg_class c ON b.relfilenode = c.relfilenode AND b.reldatabase IN (0, (SELECT oid FROM pg_database WHERE datname = current_database())) GROUP BY c.relname")
 
 $parms = array()
 
 $parms ['q'] = $_GET['q']
 
 $parms ['orderby'] = $_GET['orderby']
 
 $parms ['desc'] = $_GET['desc']
 
if(!isset($query[$parms['q']]))
if($parms['desc']!= 'desc'&&$parms['desc']!=
'asc') 
$menu = array()
 

Variable Documentation

$conn = pg_connect("service='$pgservice_core'")

Definition at line 29 of file pginfo.php.

if (!isset($query[$parms['q']])) if ($parms['desc']!= 'desc'&&$parms['desc']!= 'asc') $menu = array()

Definition at line 65 of file pginfo.php.

$parms = array()

Definition at line 53 of file pginfo.php.

$parms['q'] = $_GET['q']

Definition at line 54 of file pginfo.php.

$parms['orderby'] = $_GET['orderby']

Definition at line 55 of file pginfo.php.

$parms['desc'] = $_GET['desc']

Definition at line 56 of file pginfo.php.

$pgservice_core = getServiceCore()

Definition at line 27 of file pginfo.php.

if ($conn===false) $query = array()

Definition at line 35 of file pginfo.php.

$query['pg_settings'] = sprintf("SELECT name, setting, context, short_desc FROM pg_settings")

Definition at line 37 of file pginfo.php.

$query['pg_stat_activity'] = sprintf("SELECT datname, procpid, client_addr, client_port, waiting, query_start, now() - query_start AS time, current_query FROM pg_stat_activity WHERE procpid != pg_backend_pid()")

Definition at line 39 of file pginfo.php.

$query['tables'] = sprintf("SELECT s.schemaname, s.relname, c.oid, c.relfilenode, s.seq_scan, s.idx_scan, c.reltuples, c.relpages as pages FROM pg_stat_all_tables as s, pg_class as c WHERE s.relname = c.relname AND s.schemaname IN (SELECT nspname FROM pg_namespace WHERE oid = c.relnamespace) AND ( s.schemaname = 'public' OR s.schemaname = 'pg_toast' )")

Definition at line 41 of file pginfo.php.

$query['tables I/O'] = sprintf("SELECT schemaname, relname, heap_blks_read, heap_blks_hit, idx_blks_read, idx_blks_hit, toast_blks_read, toast_blks_hit, tidx_blks_read, tidx_blks_hit FROM pg_statio_all_tables WHERE schemaname IN ('public', 'pg_toast')")

Definition at line 43 of file pginfo.php.

$query['indexes'] = sprintf("SELECT s.schemaname, s.relname, s.indexrelname, c.oid, c.relfilenode, s.idx_scan, s.idx_tup_read, s.idx_tup_fetch, c.reltuples, c.relpages as pages FROM pg_stat_all_indexes as s, pg_class as c WHERE s.indexrelname = c.relname AND s.schemaname IN (SELECT nspname FROM pg_namespace WHERE oid = c.relnamespace) AND ( s.schemaname = 'public' OR s.schemaname = 'pg_toast' )")

Definition at line 45 of file pginfo.php.

$query['indexes I/O'] = sprintf("SELECT schemaname, relname, indexrelname, idx_blks_read, idx_blks_hit FROM pg_statio_all_indexes WHERE schemaname IN ('public', 'pg_toast')")

Definition at line 47 of file pginfo.php.

$query['vacuums'] = sprintf("SELECT s.schemaname, s.relname, c.reltuples, s.n_tup_ins, s.n_tup_upd, s.n_tup_del, s.n_tup_hot_upd, s.n_live_tup, s.n_dead_tup, s.last_vacuum, s.last_autovacuum FROM pg_stat_all_tables as s, pg_class as c WHERE s.relname = c.relname AND s.schemaname IN (SELECT nspname FROM pg_namespace WHERE oid = c.relnamespace) AND ( s.schemaname = 'public' OR s.schemaname = 'pg_toast' )")

Definition at line 49 of file pginfo.php.

$query['pg_buffercache'] = sprintf("SELECT c.relname, count(*) AS pages FROM pg_buffercache b INNER JOIN pg_class c ON b.relfilenode = c.relfilenode AND b.reldatabase IN (0, (SELECT oid FROM pg_database WHERE datname = current_database())) GROUP BY c.relname")

Definition at line 51 of file pginfo.php.

const PG_PAGE_SIZE 8 * 1024

Definition at line 23 of file pginfo.php.

← centre documentaire © anakeen