public inbox for [email protected]
help / color / mirror / Atom feedFrom: Greg Sabino Mullane <[email protected]>
To: Adrian Klaver <[email protected]>
Cc: veem v <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Question on pg_stat* views
Date: Mon, 7 Oct 2024 09:23:08 -0400
Message-ID: <CAKAnmmJ=fAU3PgrOAg20a5nH+8g=BjB8NLTEX+Mpp8kUiiyhHg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAB+=1TWE48wbtY8Sa1T2vpWHkaQ7wcodBnx8WNyTRB5D=7j1Mw@mail.gmail.com>
<[email protected]>
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
view thread (3+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Question on pg_stat* views
In-Reply-To: <CAKAnmmJ=fAU3PgrOAg20a5nH+8g=BjB8NLTEX+Mpp8kUiiyhHg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox