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

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: Capturing EXPLAIN ANALYZE for a query without discarding the normal result set
Дата
Msg-id 52D63A68.6000702@nasby.net
обсуждение исходный текст
Ответ на Re: Capturing EXPLAIN ANALYZE for a query without discarding the normal result set  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 1/13/14, 9:14 PM, Tom Lane wrote:
> Dave Cole <davejohncole@gmail.com> writes:
>> 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.
>
> What happens if the current transaction rolls back?
>
> If you want noninvasive explain data, contrib/auto_explain offers
> a solution right now.  The info goes to the postmaster log, which is
> perhaps less convenient than a temp table for interactive use, but
> it doesn't have the rollback problem --- and you can capture data
> about queries issued by a live application, without hacking the app.

The downside is that you then have to trawl through logs, which may not be easy (or in some hosting environments,
possible).

We're actually starting to do the opposite for a lot of automated stuff: we EXPLAIN ANALYZE a CTAS and then read the
temptable back out. But that's a lot more data copying than saving the EXPLAIN would be (well, at least normally ;).
 

As for rollback, dblink or FDW fixes that. Or if you're using a front-end that's sophisticated enough, you can pull it
outyourself and do whatever with it.
 
-- 
Jim C. Nasby, Data Architect                       jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: [PATCH] Negative Transition Aggregate Functions (WIP)
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Extending BASE_BACKUP in replication protocol: incremental backup and backup format