Any risk or overhead considerations for frequently executing queries against catalog tables?

From: Frits Hoogland <frits(dot)hoogland(at)gmail(dot)com>
To: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Any risk or overhead considerations for frequently executing queries against catalog tables?
Date: 2025-01-25 11:23:32
Message-ID: F3953D11-A866-49CE-80C3-F00469A2521A@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

For monitoring database behaviour and trying to build an history of activity, if I would create an application that creates a single connection and execute something like:
select * from pg_stat_activity;
select * from pg_stat_database;
select * from pg_stat_bgwriter;
select * from pg_stat_wal;
select * from pg_settings;
select * from pg_database;
For which the query is prepared, and execute that every 1 second, would there be any realistic danger or overhead that should be considered?
My thinking is that the data for these catalogs are all in shared memory and when executed serially and do not cause any significant resources to be taken?

Thanks,

Frits Hoogland

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Pavel Stehule 2025-01-25 13:32:36 Re: Any risk or overhead considerations for frequently executing queries against catalog tables?
Previous Message Laurenz Albe 2025-01-20 20:40:34 Re: Re: proposal: schema variables