P
P
pqgg7nwkd42016-07-10 00:16:20
PostgreSQL
pqgg7nwkd4, 2016-07-10 00:16:20

Postgres: How to get the EXPLAIN ANALYSE of the last request in a session?

Good afternoon.
How to get EXPLAIN ANALYSEthe last request in a session?
The idea is that after receiving the data, get the plan according to which it was carried out. This is necessary for debugging during development and for logging "in combat" for the purpose of subsequent debriefing. Please don't delve into the reason.
For example, I do:
SELECT 1
And I want to get:

?column?
1

And then:
QUERY PLAN
Result  (cost=0.00..0.01 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=1)
Planning time: 0.011 ms
Execution time: 0.011 ms

I don't want to run the query twice, and UPDATE queries can't be repeated at all.
Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question