explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4DAm

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 0.191 ↑ 1.0 3 1

Sort (cost=52.85..52.86 rows=3 width=120) (actual time=0.191..0.191 rows=3 loops=1)

  • Sort Key: pa.answer_number
  • Sort Method: quicksort Memory: 25kB
2. 0.004 0.180 ↑ 1.0 3 1

Nested Loop Left Join (cost=37.52..52.83 rows=3 width=120) (actual time=0.173..0.180 rows=3 loops=1)

3. 0.013 0.173 ↑ 1.0 3 1

Hash Join (cost=37.38..52.22 rows=3 width=96) (actual time=0.167..0.173 rows=3 loops=1)

  • Hash Cond: (pa.id = a_sum.id)
4. 0.018 0.018 ↑ 21.9 16 1

Seq Scan on poll_answer pa (cost=0.00..13.50 rows=350 width=80) (actual time=0.016..0.018 rows=16 loops=1)

5. 0.002 0.142 ↑ 1.0 3 1

Hash (cost=37.34..37.34 rows=3 width=24) (actual time=0.142..0.142 rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
6. 0.002 0.140 ↑ 1.0 3 1

Subquery Scan on a_sum (cost=37.28..37.34 rows=3 width=24) (actual time=0.137..0.140 rows=3 loops=1)

7. 0.002 0.138 ↑ 1.0 3 1

Unique (cost=37.28..37.31 rows=3 width=40) (actual time=0.136..0.138 rows=3 loops=1)

8. 0.009 0.136 ↓ 1.3 4 1

Sort (cost=37.28..37.29 rows=3 width=40) (actual time=0.135..0.136 rows=4 loops=1)

  • Sort Key: pa_1.id, (count(pr.poll_attendee_id) OVER (?)), (((count(pr.poll_attendee_id) OVER (?))::double precision / ((count(pr.poll_attendee_id) OVER (?)))::double precision))
  • Sort Method: quicksort Memory: 25kB
9. 0.008 0.127 ↓ 1.3 4 1

WindowAgg (cost=37.18..37.25 rows=3 width=40) (actual time=0.124..0.127 rows=4 loops=1)

10. 0.004 0.119 ↓ 1.3 4 1

Sort (cost=37.18..37.19 rows=3 width=40) (actual time=0.119..0.119 rows=4 loops=1)

  • Sort Key: pr.fk_poll_answer_id
  • Sort Method: quicksort Memory: 25kB
11. 0.013 0.115 ↓ 1.3 4 1

WindowAgg (cost=37.10..37.16 rows=3 width=40) (actual time=0.113..0.115 rows=4 loops=1)

12. 0.007 0.102 ↓ 1.3 4 1

Sort (cost=37.10..37.11 rows=3 width=32) (actual time=0.102..0.102 rows=4 loops=1)

  • Sort Key: pa_1.fk_poll_question_id
  • Sort Method: quicksort Memory: 25kB
13. 0.020 0.095 ↓ 1.3 4 1

Nested Loop (cost=14.80..37.08 rows=3 width=32) (actual time=0.057..0.095 rows=4 loops=1)

14. 0.018 0.043 ↓ 8.0 16 1

Hash Join (cost=14.65..29.08 rows=2 width=16) (actual time=0.030..0.043 rows=16 loops=1)

  • Hash Cond: (pa_1.fk_poll_question_id = pq.id)
15. 0.009 0.009 ↑ 21.9 16 1

Seq Scan on poll_answer pa_1 (cost=0.00..13.50 rows=350 width=16) (actual time=0.006..0.009 rows=16 loops=1)

16. 0.004 0.016 ↓ 2.0 4 1

Hash (cost=14.62..14.62 rows=2 width=8) (actual time=0.016..0.016 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
17. 0.012 0.012 ↓ 2.0 4 1

Seq Scan on poll_question pq (cost=0.00..14.62 rows=2 width=8) (actual time=0.010..0.012 rows=4 loops=1)

  • Filter: (fk_poll_id = 1)
18. 0.032 0.032 ↓ 0.0 0 16

Index Only Scan using uk_poll_result_attendee_id_answer_id on poll_result pr (cost=0.15..3.98 rows=2 width=16) (actual time=0.002..0.002 rows=0 loops=16)

  • Index Cond: (fk_poll_answer_id = pa_1.id)
  • Heap Fetches: 4
19. 0.003 0.003 ↓ 0.0 0 3

Index Scan using binary_content_pkey on binary_content bc (cost=0.14..0.20 rows=1 width=40) (actual time=0.001..0.001 rows=0 loops=3)

  • Index Cond: (id = pa.fk_image_content_id)
Planning time : 0.754 ms
Execution time : 0.323 ms