Is there a way to get both the plan and the results?

Поиск
Список
Период
Сортировка
От François Beausoleil
Тема Is there a way to get both the plan and the results?
Дата
Msg-id 66C5A79A-5E70-4082-BBEF-619FB1FE2CF7@teksol.info
обсуждение исходный текст
Ответы Re: Is there a way to get both the plan and the results?  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-general
Hi all!

Building a small tool, and it would be super useful if I could get both the query results and the plan at the same
time.At the moment, the tool accepts a SQL query, drops it into a file and call psql --file=whatever.sql. I can change
touse a lower-level API if necessary. 

Ideally, I’d like to do something like EXLAIN (ANALYZE, RESULTS) SELECT ...

I’m talking about multi-minute queries, so it’s less than ideal if I have to run the query twice: once for EXPLAIN
ANALYZE,once for the actual results. 

Looking around, https://duckduckgo.com/?q=postgresql+get+query+results+and+query+plan+in+single+call doesn’t return
anythinguseful. Google neither, for that matter. The PG mailing list archives seem to not have any results on that. 

I’m specifically using 9.1. Not opposed to upgrade if necessary.

Thanks!
François Beausoleil



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

Предыдущее
От: Jonathan Vanasco
Дата:
Сообщение: Re: improving speed of query that uses a multi-column "filter" ?
Следующее
От: David G Johnston
Дата:
Сообщение: Re: Is there a way to get both the plan and the results?