Capturing EXPLAIN ANALYZE for a query without discarding the normal result set

From: Dave Cole <davejohncole(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Capturing EXPLAIN ANALYZE for a query without discarding the normal result set
Date: 2014-01-14 03:06:20
Message-ID: CANwCXGTQSrZbAx2iq7tj5u8p_H1xgkzW-Z-ymXABUh9nHgD9gA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I apologise for dropping this out of nowhere. I had an idea about EXPLAIN
ANALYZE that would be very useful for the system we are developing and
supporting.

It would be really cool if you could direct the EXPLAIN ANALYZE output to a
temporary table so that the query being analyzed could execute normally.
Something like this:

EXPLAIN ANALYZE INTO a_temp
SELECT ....

Then we could temporarily cause our application to log EXPLAIN ANALYZE
information for certain queries without disrupting normal operation of the
system. In the case when we notice long running queries we would then
immediately follow up the original query with a select on the temporay
table.

We deal with a lot of transient data, so the conditions that cause bad
query performance are not always reproducible.

I have no idea how feasible this is, so please feel free to tell me I am an
idiot.

- Dave

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marti Raudsepp 2014-01-14 03:13:09 Re: Capturing EXPLAIN ANALYZE for a query without discarding the normal result set
Previous Message Etsuro Fujita 2014-01-14 02:59:43 Comment typo in src/include/access/gin_private.h