R
R
Rrooom2014-10-02 17:34:14
PostgreSQL
Rrooom, 2014-10-02 17:34:14

How to use EXPLAIN in PostgreSQL?

Here I have a rather long query plan in front of me.
How to read it? What takes a long time and what doesn't? Which indexes to create, and which ones are superfluous?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Chistyakov, 2014-10-02
@alexclear

Next to each step of the query plan is the approximate cost of the step.
If you do EXPLAIN ANALYZE, the real cost of the step will also be indicated.
Show me the plan? In a nutshell, it is impossible to teach how to read plans without an example.
Yes, superfluous indexes are visible not in plans. They can be seen in the index usage statistics.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question