Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.postgresql > #905

Re: Get explain plan while query running

From George Neuner <gneuner2@comcast.net>
Newsgroups comp.databases.postgresql
Subject Re: Get explain plan while query running
Date 2022-03-11 10:04 -0500
Organization A noiseless patient Spider
Message-ID <2eom2ht13dh49i3lqqjponfj5cajsl4i72@4ax.com> (permalink)
References <1add5218-f1fa-4e34-a5ee-a399c19c6c1bn@googlegroups.com>

Show all headers | View raw


On Thu, 10 Mar 2022 08:31:23 -0800 (PST), Rich Ford
<richford990@gmail.com> wrote:

>Is there a way to get the explain plan for a running query as opposed
>to having to wait for the query to complete which is the case when
>using EXPLAIN.

AFAIK, if you do /not/ specify analyze, explain only returns the plan
and does not also execute the query.  However, without analyze the
estimates of cost may be wildly inaccurate if statistics on the tables
and indexes are not up to date.


>I know in Oracle there is DBMS_XPLAN and wondering if something
>similar in PostgreSQL. We have looked at auto_explain but this
>requires a cluster reboot and this is production and we have no
>downtime.
>
>This is Aurora PostgreSQL 12.6.

[Assuming this has something to do with your previous post]
auto_explain won't help anyway if you can't wait for the problem
queries to execute.


George

Back to comp.databases.postgresql | Previous | NextPrevious in thread | Find similar


Thread

Get explain plan while query running Rich Ford <richford990@gmail.com> - 2022-03-10 08:31 -0800
  Re: Get explain plan while query running George Neuner <gneuner2@comcast.net> - 2022-03-11 10:04 -0500

csiph-web