explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2kw1 : b.c. gb forms, total ASC

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 4,766.859 ↑ 1.0 20 1

Limit (cost=358,845.43..358,845.48 rows=20 width=16) (actual time=4,766.838..4,766.859 rows=20 loops=1)

  • Buffers: shared hit=163377 dirtied=3, temp read=6578 written=11630
2. 0.219 4,766.839 ↑ 10.9 20 1

Sort (cost=358,845.43..358,845.98 rows=218 width=16) (actual time=4,766.837..4,766.839 rows=20 loops=1)

  • Sort Key: (count(DISTINCT form_responses.id))
  • Sort Method: top-N heapsort Memory: 28kB
  • Buffers: shared hit=163377 dirtied=3, temp read=6578 written=11630
3. 1,105.630 4,766.620 ↑ 1.8 122 1

GroupAggregate (cost=314,433.48..358,839.63 rows=218 width=16) (actual time=1,537.522..4,766.620 rows=122 loops=1)

  • Group Key: form_responses.form_id
  • Buffers: shared hit=163377 dirtied=3, temp read=6578 written=11630
4. 728.085 3,659.526 ↓ 1.0 1,599,471 1

Merge Join (cost=314,433.48..341,824.39 rows=1,544,575 width=16) (actual time=1,529.458..3,659.526 rows=1,599,471 loops=1)

  • Merge Cond: (forms.id = form_responses.form_id)
  • Buffers: shared hit=162273 dirtied=3, temp read=5084 written=10136
5. 1.808 1.808 ↑ 1.0 5,492 1

Index Only Scan using forms_pkey on forms (cost=0.28..355.43 rows=5,635 width=4) (actual time=0.008..1.808 rows=5,492 loops=1)

  • Heap Fetches: 43
  • Buffers: shared hit=52
6. 770.973 2,929.633 ↓ 1.0 1,599,471 1

Materialize (cost=314,432.02..322,154.89 rows=1,544,575 width=16) (actual time=1,529.196..2,929.633 rows=1,599,471 loops=1)

  • Buffers: shared hit=162221 dirtied=3, temp read=5084 written=10136
7. 1,403.221 2,158.660 ↓ 1.0 1,599,471 1

Sort (cost=314,432.02..318,293.45 rows=1,544,575 width=16) (actual time=1,529.193..2,158.660 rows=1,599,471 loops=1)

  • Sort Key: form_responses.form_id
  • Sort Method: external merge Disk: 40632kB
  • Buffers: shared hit=162221 dirtied=3, temp read=5084 written=5084
8. 755.439 755.439 ↓ 1.0 1,599,471 1

Index Only Scan using form_responses_form_id_mailing_id_covering_index on form_responses (cost=0.56..129,262.14 rows=1,544,575 width=16) (actual time=0.020..755.439 rows=1,599,471 loops=1)

  • Index Cond: (project_id = 20006)
  • Filter: ((deleted IS NOT TRUE) AND (is_unanswered IS NOT TRUE))
  • Rows Removed by Filter: 26819
  • Heap Fetches: 279
  • Buffers: shared hit=162221 dirtied=3
9.          

SubPlan (forGroupAggregate)

10. 0.976 0.976 ↑ 1.0 1 122

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

  • Index Cond: (id = form_responses.form_id)
  • Buffers: shared hit=368
11. 0.244 0.244 ↑ 1.0 1 122

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

  • Index Cond: (id = form_responses.form_id)
  • Buffers: shared hit=368
12. 0.244 0.244 ↑ 1.0 1 122

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

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