You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding metrics for tables is important as it allows you to monitor what causes troubles into your database.
You can use this query to have informations over your tables :
Adding the result of this query into the metrics collected :
SELECT
pg_stat.*,
pg_statio.*,
pgc.*,
pg_relation_size(pgc.oid)
FROM pg_catalog.pg_stat_user_tables AS pg_stat
LEFT JOIN pg_catalog.pg_statio_user_tables AS pg_statio
ON pg_statio.relid = pg_stat.relid
LEFT JOIN pg_catalog.pg_class AS pgc
ON pgc.oid = pg_stat.relid
;
Why ?
Because you can tracks each table into the database wich helps you to monitor what table can cause trouble.
Some examples :
seq_scan over seq_tup_read allows you to know if you need index
Which table haven't been autovacuumed.
The size of each relations (aka table) : size, nb of tuples, nb of pages
Number of deadrows
This need to be desactivated as this request return as many line as the number of table into the database.
The text was updated successfully, but these errors were encountered:
Ok I think thats because the pg_stat_user_tables and the pg_statio_user_tables is not activated by default... (the doc says that this is activated by default...)
I will give it a try and closed this issue or change what I need.
Sorry
Ok these metrics are implemented but the last postgres_exporter doesn't show these on PostgreSQL 11 - Windows 11.
I check other tests and will give you more details
Ok I found the trouble : I was connected to the "postgres" database which doesn't contain anything... If I specify another databse in the same instance, I have my statistics.
The documentation should indicate that the data collected are only for one database and not for the whole instance.
This is more or less link to the #999 issue.
I will close this one but keep this explaination for other people.
Proposal
Adding metrics for tables is important as it allows you to monitor what causes troubles into your database.
You can use this query to have informations over your tables :
Adding the result of this query into the metrics collected :
Why ?
Because you can tracks each table into the database wich helps you to monitor what table can cause trouble.
Some examples :
This need to be desactivated as this request return as many line as the number of table into the database.
The text was updated successfully, but these errors were encountered: