explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NYxJ : nrs score

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 10.164 ↓ 4.5 9 1

Limit (cost=99.36..99.37 rows=2 width=27) (actual time=10.159..10.164 rows=9 loops=1)

  • Buffers: shared hit=620
2. 0.016 10.159 ↓ 4.5 9 1

Sort (cost=99.36..99.37 rows=2 width=27) (actual time=10.158..10.159 rows=9 loops=1)

  • Sort Key: (max(form_responses.created_time))
  • Sort Method: quicksort Memory: 27kB
  • Buffers: shared hit=620
3. 4.830 10.143 ↓ 4.5 9 1

GroupAggregate (cost=48.42..99.35 rows=2 width=27) (actual time=5.364..10.143 rows=9 loops=1)

  • Group Key: form_responses.mailing_id
  • Buffers: shared hit=620
4. 1.973 5.241 ↓ 1,810.0 3,620 1

Sort (cost=48.42..48.43 rows=2 width=27) (actual time=4.497..5.241 rows=3,620 loops=1)

  • Sort Key: form_responses.mailing_id
  • Sort Method: quicksort Memory: 379kB
  • Buffers: shared hit=512
5. 1.420 3.268 ↓ 1,810.0 3,620 1

Nested Loop (cost=5.05..48.41 rows=2 width=27) (actual time=0.045..3.268 rows=3,620 loops=1)

  • Buffers: shared hit=512
6. 0.035 0.048 ↓ 9.0 9 1

Bitmap Heap Scan on mailings (cost=4.49..39.15 rows=1 width=4) (actual time=0.024..0.048 rows=9 loops=1)

  • Recheck Cond: (mailing_group_id = 5812)
  • Filter: ((deleted IS NOT TRUE) AND (active IS TRUE) AND (project_id = 20001) AND ((form_type)::text = 'email-satisfaction'::text) AND ((leading_question_type)::text = 'nrs-5'::text))
  • Heap Blocks: exact=8
  • Buffers: shared hit=11
7. 0.013 0.013 ↑ 1.0 9 1

Bitmap Index Scan on mailings_mailing_group_id_index (cost=0.00..4.49 rows=9 width=0) (actual time=0.013..0.013 rows=9 loops=1)

  • Index Cond: (mailing_group_id = 5812)
  • Buffers: shared hit=3
8. 1.800 1.800 ↓ 19.1 402 9

Index Only Scan using form_responses_form_id_mailing_id_covering_index on form_responses (cost=0.56..9.05 rows=21 width=27) (actual time=0.007..0.200 rows=402 loops=9)

  • Index Cond: ((project_id = 20001) AND (mailing_id = mailings.id))
  • Filter: ((deleted IS NOT TRUE) AND (is_unanswered IS NOT TRUE))
  • Rows Removed by Filter: 14
  • Heap Fetches: 0
  • Buffers: shared hit=501
9.          

SubPlan (forGroupAggregate)

10. 0.045 0.045 ↑ 1.0 1 9

Index Scan using mailings_pkey on mailings mailings_1 (cost=0.42..8.44 rows=1 width=33) (actual time=0.005..0.005 rows=1 loops=9)

  • Index Cond: (id = form_responses.mailing_id)
  • Buffers: shared hit=36
11. 0.009 0.009 ↑ 1.0 1 9

Index Scan using mailings_pkey on mailings mailings_2 (cost=0.42..8.44 rows=1 width=18) (actual time=0.001..0.001 rows=1 loops=9)

  • Index Cond: (id = form_responses.mailing_id)
  • Buffers: shared hit=36
12. 0.018 0.018 ↑ 1.0 1 9

Index Scan using mailings_pkey on mailings mailings_3 (cost=0.42..8.44 rows=1 width=9) (actual time=0.001..0.002 rows=1 loops=9)

  • Index Cond: (id = form_responses.mailing_id)
  • Buffers: shared hit=36