explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Yd7h : vf group by forms, sort last received DESC

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 669.785 ↑ 1.0 20 1

Limit (cost=48,808.93..48,808.98 rows=20 width=16) (actual time=669.774..669.785 rows=20 loops=1)

  • Buffers: shared hit=34162 read=199 dirtied=2, temp read=727 written=1451
2. 0.034 669.777 ↑ 1.6 20 1

Sort (cost=48,808.93..48,809.01 rows=32 width=16) (actual time=669.773..669.777 rows=20 loops=1)

  • Sort Key: (max(form_responses.created_time))
  • Sort Method: quicksort Memory: 29kB
  • Buffers: shared hit=34162 read=199 dirtied=2, temp read=727 written=1451
3. 99.088 669.743 ↑ 1.6 20 1

GroupAggregate (cost=42,117.78..48,808.13 rows=32 width=16) (actual time=307.682..669.743 rows=20 loops=1)

  • Group Key: form_responses.form_id
  • Buffers: shared hit=34162 read=199 dirtied=2, temp read=727 written=1451
4. 96.520 570.355 ↓ 1.0 228,760 1

Merge Join (cost=42,117.78..46,351.24 rows=221,292 width=16) (actual time=307.534..570.355 rows=228,760 loops=1)

  • Merge Cond: (forms.id = form_responses.form_id)
  • Buffers: shared hit=33982 read=199 dirtied=2, temp read=727 written=1451
5. 1.549 1.549 ↑ 1.1 5,145 1

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

  • Heap Fetches: 19
  • Buffers: shared hit=43
6. 101.739 472.286 ↓ 1.0 228,760 1

Materialize (cost=42,116.31..43,222.77 rows=221,292 width=16) (actual time=307.453..472.286 rows=228,760 loops=1)

  • Buffers: shared hit=33939 read=199 dirtied=2, temp read=727 written=1451
7. 199.298 370.547 ↓ 1.0 228,760 1

Sort (cost=42,116.31..42,669.54 rows=221,292 width=16) (actual time=307.448..370.547 rows=228,760 loops=1)

  • Sort Key: form_responses.form_id
  • Sort Method: external merge Disk: 5808kB
  • Buffers: shared hit=33939 read=199 dirtied=2, temp read=727 written=727
8. 171.249 171.249 ↓ 1.0 228,760 1

Index Only Scan using form_responses_form_id_mailing_id_covering_index on form_responses (cost=0.56..18,686.96 rows=221,292 width=16) (actual time=0.040..171.249 rows=228,760 loops=1)

  • Index Cond: (project_id = 20001)
  • Filter: ((deleted IS NOT TRUE) AND (is_unanswered IS NOT TRUE))
  • Rows Removed by Filter: 11247
  • Heap Fetches: 161
  • Buffers: shared hit=33939 read=199 dirtied=2
9.          

SubPlan (forGroupAggregate)

10. 0.220 0.220 ↑ 1.0 1 20

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

  • Index Cond: (id = form_responses.form_id)
  • Buffers: shared hit=60
11. 0.040 0.040 ↑ 1.0 1 20

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=20)

  • Index Cond: (id = form_responses.form_id)
  • Buffers: shared hit=60
12. 0.040 0.040 ↑ 1.0 1 20

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=20)

  • Index Cond: (id = form_responses.form_id)
  • Buffers: shared hit=60
Planning time : 1.156 ms