Search Postgresql Archives

Re: Question on pg_stat* views

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adrian and Veem were saying:
 > so does it mean that we should increase the pg_stat_statement.max to further higher value?

Yes, you should raise this setting if you find your queries are getting pushed out. Moving to version 17 will also help, as myself and others have been working on normalizing more queries, which means less overall entries in pg_stat_statements, and more room before hitting pg_stat_statements.max. But bump it to 10000 for now.

Now what I don't know is if pg_stat_statement exhibits the same behavior
as the core statistics and resets on an unclean shutdown.

It does - pg_stat_statements will be emptied out if Postgres restarts after a crash.

> 3)As pg_stat_statements holds the aggregated stats of all the execution
> for a particular sql query ,so it's not easy to identify if in the past
> at some point in time the same query suffered and thus went for high
> response time. So to debug such performance  issues scenarios , is it
> advisable to insert the records from this pg_stat* views to another
> table manually periodically through a cron job?

Typically, you use pg_stat_statements in conjunction with a good log_min_duration_statements setting to allow you to see specific slow queries as well as the aggregated info. It's also a good idea to rotate things via cron, as you mention.

Cheers,
Greg


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux