Reputation: 10969
I've read the documentation but I'd like to ask a more specific question in trying to understanding the EXPLAIN output.
The final step of a query is a nested loop left join and it says the cost is 0.01 ... 3108.35 rows=1 width=185
. This step has a big grey arrow to an aggregate call which says cost 3044.87 ... 3044.89 rows=1 width=16
.
Can someone breakdown what this is telling me? This is a relatively slow query that I am trying to optimize, and I'm trying to understand the cost aspect of the postgres explain output.
Upvotes: 3
Views: 973
Reputation: 2074
I'll answer the question you specifically asked, but you probably need to post more information to get the answer you actually want:
What the graph is telling you is that the aggregate is what is taking up the vast majority of the query time. I would guess that the input to that aggregate is a sequential scan (based on the icon), and that sequential scan is the biggest contributor in its own right to the final output.
But, as someone commented above, go to explain.depesz.com and post a link to it for more thorough information
Upvotes: 1