mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-23 01:06:31 -06:00
Support server and database statistics on Greenplum. Fixes #3004
This commit is contained in:
parent
c32eb6bd37
commit
ed3e374df6
@ -10,16 +10,9 @@ SELECT
|
|||||||
tup_inserted AS {{ conn|qtIdent(_('Tuples inserted')) }},
|
tup_inserted AS {{ conn|qtIdent(_('Tuples inserted')) }},
|
||||||
tup_updated AS {{ conn|qtIdent(_('Tuples updated')) }},
|
tup_updated AS {{ conn|qtIdent(_('Tuples updated')) }},
|
||||||
tup_deleted AS {{ conn|qtIdent(_('Tuples deleted')) }},
|
tup_deleted AS {{ conn|qtIdent(_('Tuples deleted')) }},
|
||||||
stats_reset AS {{ conn|qtIdent(_('Last statistics reset')) }},
|
|
||||||
slave.confl_tablespace AS {{ conn|qtIdent(_('Tablespace conflicts')) }},
|
|
||||||
slave.confl_lock AS {{ conn|qtIdent(_('Lock conflicts')) }},
|
|
||||||
slave.confl_snapshot AS {{ conn|qtIdent(_('Snapshot conflicts')) }},
|
|
||||||
slave.confl_bufferpin AS {{ conn|qtIdent(_('Bufferpin conflicts')) }},
|
|
||||||
slave.confl_deadlock AS {{ conn|qtIdent(_('Deadlock conflicts')) }},
|
|
||||||
pg_database_size(db.datid) AS {{ conn|qtIdent(_('Size')) }}
|
pg_database_size(db.datid) AS {{ conn|qtIdent(_('Size')) }}
|
||||||
FROM
|
FROM
|
||||||
pg_stat_database db
|
pg_stat_database db
|
||||||
LEFT JOIN pg_stat_database_conflicts slave ON db.datid=slave.datid
|
|
||||||
WHERE {% if did %}
|
WHERE {% if did %}
|
||||||
db.datid = {{ did|qtLiteral }}::OID{% else %}
|
db.datid = {{ did|qtLiteral }}::OID{% else %}
|
||||||
db.datid > {{ last_system_oid|qtLiteral }}::OID
|
db.datid > {{ last_system_oid|qtLiteral }}::OID
|
||||||
|
@ -4,8 +4,6 @@ SELECT
|
|||||||
datname AS {{ conn|qtIdent(_('Database')) }},
|
datname AS {{ conn|qtIdent(_('Database')) }},
|
||||||
backend_start AS {{ conn|qtIdent(_('Backend start')) }},
|
backend_start AS {{ conn|qtIdent(_('Backend start')) }},
|
||||||
CASE
|
CASE
|
||||||
WHEN client_hostname IS NOT NULL AND client_hostname != '' THEN
|
|
||||||
client_hostname || ':' || client_port
|
|
||||||
WHEN client_addr IS NOT NULL AND client_addr::text != '' THEN
|
WHEN client_addr IS NOT NULL AND client_addr::text != '' THEN
|
||||||
client_addr::text || ':' || client_port
|
client_addr::text || ':' || client_port
|
||||||
WHEN client_port = -1 THEN
|
WHEN client_port = -1 THEN
|
||||||
@ -26,11 +24,9 @@ UNION
|
|||||||
SELECT
|
SELECT
|
||||||
procpid AS "PID",
|
procpid AS "PID",
|
||||||
usename AS {{ conn|qtIdent(_('User')) }},
|
usename AS {{ conn|qtIdent(_('User')) }},
|
||||||
datname AS {{ conn|qtIdent(_('Database')) }},
|
'' AS {{ conn|qtIdent(_('Database')) }},
|
||||||
backend_start AS {{ conn|qtIdent(_('Backend start')) }},
|
backend_start AS {{ conn|qtIdent(_('Backend start')) }},
|
||||||
CASE
|
CASE
|
||||||
WHEN client_hostname IS NOT NULL AND client_hostname != '' THEN
|
|
||||||
client_hostname || ':' || client_port
|
|
||||||
WHEN client_addr IS NOT NULL AND client_addr::text != '' THEN
|
WHEN client_addr IS NOT NULL AND client_addr::text != '' THEN
|
||||||
client_addr::text || ':' || client_port
|
client_addr::text || ':' || client_port
|
||||||
WHEN client_port = -1 THEN
|
WHEN client_port = -1 THEN
|
||||||
@ -38,7 +34,7 @@ SELECT
|
|||||||
ELSE
|
ELSE
|
||||||
'localhost:' || client_port
|
'localhost:' || client_port
|
||||||
END AS {{ conn|qtIdent(_('Client')) }},
|
END AS {{ conn|qtIdent(_('Client')) }},
|
||||||
{{ _('Streaming Replication') }}|qtLiteral AS {{ conn|qtIdent(_('Application')) }},
|
{{ _('Streaming Replication')|qtLiteral }} AS {{ conn|qtIdent(_('Application')) }},
|
||||||
null AS {{ conn|qtIdent(_('Waiting?')) }},
|
null AS {{ conn|qtIdent(_('Waiting?')) }},
|
||||||
state || ' [sync (state: ' || COALESCE(sync_state, '') || ', priority: ' || sync_priority::text || ')] (' || sent_location || ' sent, ' || write_location || ' written, ' || flush_location || ' flushed, ' || replay_location || ' applied)' AS {{ conn|qtIdent(_('Query')) }},
|
state || ' [sync (state: ' || COALESCE(sync_state, '') || ', priority: ' || sync_priority::text || ')] (' || sent_location || ' sent, ' || write_location || ' written, ' || flush_location || ' flushed, ' || replay_location || ' applied)' AS {{ conn|qtIdent(_('Query')) }},
|
||||||
null AS {{ conn|qtIdent(_('Query start')) }},
|
null AS {{ conn|qtIdent(_('Query start')) }},
|
||||||
|
Loading…
Reference in New Issue
Block a user