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