Capturing EXPLAIN ANALYZE for a query without discarding the normal result set - Mailing list pgsql-hackers

From Dave Cole
Subject Capturing EXPLAIN ANALYZE for a query without discarding the normal result set
Date
Msg-id CANwCXGTQSrZbAx2iq7tj5u8p_H1xgkzW-Z-ymXABUh9nHgD9gA@mail.gmail.com
Whole thread Raw
Responses Re: Capturing EXPLAIN ANALYZE for a query without discarding the normal result set  (Marti Raudsepp <marti@juffo.org>)
Re: Capturing EXPLAIN ANALYZE for a query without discarding the normal result set  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-hackers by date:

Previous
From: "Etsuro Fujita"
Date:
Subject: Comment typo in src/include/access/gin_private.h
Next
From: Marti Raudsepp
Date:
Subject: Re: Capturing EXPLAIN ANALYZE for a query without discarding the normal result set