pgAdmin4 query

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

pgAdmin4 query

Polgár Benedek

Dear Support Team!

 

We find that The gpAdmin4 generates too many query.

 

for example:

SELECT 'session_stats' AS chart_name, row_to_json(t) AS chart_data

        FROM (SELECT

           (SELECT count(*) FROM pg_stat_activity WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Total",

           (SELECT count(*) FROM pg_stat_activity WHERE state = 'active' AND datname = (SELECT datname FROM pg_database WHERE oid = 1433952))  AS "Active",

           (SELECT count(*) FROM pg_stat_activity WHERE state = 'idle' AND datname = (SELECT datname FROM pg_database WHERE oid = 1433952))  AS "Idle"

        ) t

        UNION ALL

        SELECT 'tps_stats' AS chart_name, row_to_json(t) AS chart_data

        FROM (SELECT

           (SELECT sum(xact_commit) + sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Transactions",

           (SELECT sum(xact_commit) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Commits",

           (SELECT sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Rollbacks"

        ) t

        UNION ALL

        SELECT 'ti_stats' AS chart_name, row_to_json(t) AS chart_data

        FROM (SELECT

           (SELECT sum(tup_inserted) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Inserts",

           (SELECT sum(tup_updated) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Updates",

           (SELECT sum(tup_deleted) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Deletes"

        ) t

        UNION ALL

        SELECT 'to_stats' AS chart_name, row_to_json(t) AS chart_data

        FROM (SELECT

           (SELECT sum(tup_fetched) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Fetched",

           (SELECT sum(tup_returned) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Returned"

        ) t

        UNION ALL

        SELECT 'bio_stats' AS chart_name, row_to_json(t) AS chart_data

        FROM (SELECT

           (SELECT sum(blks_read) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Reads",

           (SELECT sum(blks_hit) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Hits"

        ) t

 

 

Can I disable these queries?

 

______________________________________________________________

Best Regardsl:

 

Benedek Polgár

System administrator

 

[hidden email]

 

cid:image001.png@01CF9768.53366360

 

Tel.: +36-1-776-6901

Fax: +36-1-776-6902

1093 Budapest, Közraktár u. 30-32.

RiverPark, K30. épület, II. emelet

 

cid:image002.png@01D100FE.9034AF00  cid:image003.png@01D100FE.9034AF00  

 

Reply | Threaded
Open this post in threaded view
|

Re: pgAdmin4 query

Murtuza Zabuawala
Hi,

On Thu, 13 Jun 2019, 19:49 Polgár Benedek, <[hidden email]> wrote:

Dear Support Team!

 

We find that The gpAdmin4 generates too many query.

 

for example:

SELECT 'session_stats' AS chart_name, row_to_json(t) AS chart_data

        FROM (SELECT

           (SELECT count(*) FROM pg_stat_activity WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Total",

           (SELECT count(*) FROM pg_stat_activity WHERE state = 'active' AND datname = (SELECT datname FROM pg_database WHERE oid = 1433952))  AS "Active",

           (SELECT count(*) FROM pg_stat_activity WHERE state = 'idle' AND datname = (SELECT datname FROM pg_database WHERE oid = 1433952))  AS "Idle"

        ) t

        UNION ALL

        SELECT 'tps_stats' AS chart_name, row_to_json(t) AS chart_data

        FROM (SELECT

           (SELECT sum(xact_commit) + sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Transactions",

           (SELECT sum(xact_commit) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Commits",

           (SELECT sum(xact_rollback) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Rollbacks"

        ) t

        UNION ALL

        SELECT 'ti_stats' AS chart_name, row_to_json(t) AS chart_data

        FROM (SELECT

           (SELECT sum(tup_inserted) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Inserts",

           (SELECT sum(tup_updated) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Updates",

           (SELECT sum(tup_deleted) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Deletes"

        ) t

        UNION ALL

        SELECT 'to_stats' AS chart_name, row_to_json(t) AS chart_data

        FROM (SELECT

           (SELECT sum(tup_fetched) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Fetched",

           (SELECT sum(tup_returned) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Returned"

        ) t

        UNION ALL

        SELECT 'bio_stats' AS chart_name, row_to_json(t) AS chart_data

        FROM (SELECT

           (SELECT sum(blks_read) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Reads",

           (SELECT sum(blks_hit) FROM pg_stat_database WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1433952)) AS "Hits"

        ) t

 

 

Can I disable these queries?

pgAdmin4 runs these queries to populate the data required to render the charts on the Dashboard panel, If you want to disable the charts then you can do it from preferences dialog.

File -> Preferences -> Dashboards -> Display -> Show graphs?
Set it to False.


-- Murtuza

 

______________________________________________________________

Best Regardsl:

 

Benedek Polgár

System administrator

 

[hidden email]

 

 

Tel.: +36-1-776-6901

Fax: +36-1-776-6902

1093 Budapest, Közraktár u. 30-32.

RiverPark, K30. épület, II. emelet

 

    

 


image001.jpg (2K) Download Attachment
image002.png (4K) Download Attachment
image003.png (3K) Download Attachment