explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2cFc

Settings
# exclusive inclusive rows x rows loops node
1. 0.013 11,807.398 ↑ 26.8 4 1

Sort (cost=163,743.21..163,743.48 rows=107 width=16) (actual time=11,807.397..11,807.398 rows=4 loops=1)

  • Sort Key: (max(form_responses.created_time))
  • Sort Method: quicksort Memory: 26kB
  • Buffers: shared hit=166707 read=19764 dirtied=17
2. 360.034 11,807.385 ↑ 26.8 4 1

GroupAggregate (cost=142,296.46..163,739.60 rows=107 width=16) (actual time=11,479.393..11,807.385 rows=4 loops=1)

  • Group Key: form_responses.form_id
  • Buffers: shared hit=166707 read=19764 dirtied=17
3. 333.625 11,447.271 ↑ 1.0 778,211 1

Merge Join (cost=142,296.46..154,343.08 rows=779,038 width=16) (actual time=10,963.710..11,447.271 rows=778,211 loops=1)

  • Merge Cond: (forms.id = form_responses.form_id)
  • Buffers: shared hit=166659 read=19764 dirtied=17
4. 0.901 0.901 ↑ 1.6 3,520 1

Index Only Scan using forms_pkey on forms (cost=0.28..355.43 rows=5,635 width=4) (actual time=0.009..0.901 rows=3,520 loops=1)

  • Heap Fetches: 10
  • Buffers: shared hit=30
5. 436.280 11,112.745 ↑ 1.0 778,211 1

Sort (cost=142,295.00..144,242.60 rows=779,038 width=16) (actual time=10,962.546..11,112.745 rows=778,211 loops=1)

  • Sort Key: form_responses.form_id
  • Sort Method: quicksort Memory: 61055kB
  • Buffers: shared hit=166629 read=19764 dirtied=17
6. 10,676.465 10,676.465 ↑ 1.0 778,211 1

Index Only Scan using form_responses_form_id_mailing_id_covering_index on form_responses (cost=0.56..66,060.94 rows=779,038 width=16) (actual time=0.032..10,676.465 rows=778,211 loops=1)

  • Index Cond: (project_id = 20206)
  • Filter: ((deleted IS NOT TRUE) AND (is_unanswered IS NOT TRUE))
  • Rows Removed by Filter: 45720
  • Heap Fetches: 1499
  • Buffers: shared hit=166629 read=19764 dirtied=17
7.          

SubPlan (forGroupAggregate)

8. 0.052 0.052 ↑ 1.0 1 4

Index Scan using forms_pkey on forms forms_1 (cost=0.28..8.30 rows=1 width=26) (actual time=0.013..0.013 rows=1 loops=4)

  • Index Cond: (id = form_responses.form_id)
  • Buffers: shared hit=12
9. 0.012 0.012 ↑ 1.0 1 4

Index Scan using forms_pkey on forms forms_2 (cost=0.28..8.30 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=4)

  • Index Cond: (id = form_responses.form_id)
  • Buffers: shared hit=12
10. 0.008 0.008 ↑ 1.0 1 4

Index Scan using forms_pkey on forms forms_3 (cost=0.28..8.30 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=4)

  • Index Cond: (id = form_responses.form_id)
  • Buffers: shared hit=12
11. 0.008 0.008 ↑ 1.0 1 4

Index Scan using forms_pkey on forms forms_4 (cost=0.28..8.30 rows=1 width=18) (actual time=0.001..0.002 rows=1 loops=4)

  • Index Cond: (id = form_responses.form_id)
  • Buffers: shared hit=12