we have multiple schemas in our Postgres database and would like to know if there is a way or any extension that help in segregating schema metrics from pg_stat_statements and pg_stat_activity.
we have 5 schemas each schema will have same set of tables want to to know which schema is mostly being used. and analyze stats like how many times particular query run in particular schema. i don’t want to go in each query and look for schema mentioned inthose queries
Per the docs pg_stat_statements, no. You can only differentiate by database.
Note that a single query can use tables in different schemas, even if that isn’t the case in your setup.