public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: veem v <[email protected]>
To: pgsql-general <[email protected]>
Subject: Re: Debugging query performance in postgres
Date: Thu, 4 Sep 2025 10:49:18 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAB+=1TWW+iPTtH-P+-b8CdS0fPvt2+8B7OQ5gS9ostuoPvMJqg@mail.gmail.com>
References: <CAB+=1TWW+iPTtH-P+-b8CdS0fPvt2+8B7OQ5gS9ostuoPvMJqg@mail.gmail.com>

On 9/4/25 09:57, veem v wrote:
> Hello,
> We have a situation in which we had a dml query within a procedure that 
> was running fine but suddenly the plan flipped and it started running 
> longer. It took us a good amount of time to identify the cause and fix 
> it. So I have below questions,

What was the cause?

Postgres version

Was there any major changes in the database e.g schema changes or 
quantity of data?

Is autovacuum running?

> 1)Do we have any data dictionary view or query available which gives us 
> information on what were the queryids those are executing from within a 
> procedure and how much time they are taking?
> 2)Also how to identify , if any specific queries has opted a different 
> plan today as compared to past executions and also response time 
> increased because of that?

Take a look at:

https://www.postgresql.org/docs/current/pgstatstatements.html

> 
> Regards
> Veem


-- 
Adrian Klaver
[email protected]






view thread (5+ messages)  latest in thread

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]
  Subject: Re: Debugging query performance in postgres
  In-Reply-To: <[email protected]>

* 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