explain.depesz.com

PostgreSQL's explain analyze made readable

Result: y8na : sentiment, order by name

Settings
# exclusive inclusive rows x rows loops node
1. 0.014 41.559 ↑ 1.0 20 1

Limit (cost=8,746.89..8,746.94 rows=20 width=27) (actual time=41.546..41.559 rows=20 loops=1)

  • Buffers: shared hit=12141
2. 0.299 41.545 ↑ 3.0 20 1

Sort (cost=8,746.89..8,747.04 rows=61 width=27) (actual time=41.544..41.545 rows=20 loops=1)

  • Sort Key: ((SubPlan 1))
  • Sort Method: top-N heapsort Memory: 30kB
  • Buffers: shared hit=12141
3. 9.119 41.246 ↓ 2.0 121 1

GroupAggregate (cost=7,156.11..8,745.26 rows=61 width=27) (actual time=28.632..41.246 rows=121 loops=1)

  • Group Key: form_responses.mailing_id
  • Buffers: shared hit=12141
4. 7.875 31.159 ↓ 18.0 14,289 1

Sort (cost=7,156.11..7,158.09 rows=792 width=27) (actual time=28.569..31.159 rows=14,289 loops=1)

  • Sort Key: form_responses.mailing_id
  • Sort Method: quicksort Memory: 1501kB
  • Buffers: shared hit=10689
5. 6.721 23.284 ↓ 18.0 14,289 1

Nested Loop (cost=0.98..7,117.98 rows=792 width=27) (actual time=0.309..23.284 rows=14,289 loops=1)

  • Buffers: shared hit=10689
6. 1.363 1.363 ↓ 1.3 1,900 1

Index Only Scan using mailings_covering_index on mailings (cost=0.42..297.68 rows=1,423 width=4) (actual time=0.231..1.363 rows=1,900 loops=1)

  • Index Cond: ((project_id = 20006) AND (active = true) AND (mailing_group_id IS NULL) AND (form_type = 'email-satisfaction'::text) AND (leading_question_type = 'sentiment'::text))
  • Filter: ((deleted IS NOT TRUE) AND (active IS TRUE))
  • Rows Removed by Filter: 1
  • Heap Fetches: 2
  • Buffers: shared hit=61
7. 15.200 15.200 ↓ 1.3 8 1,900

Index Only Scan using form_responses_covering_mailing_id_first_index on form_responses (cost=0.56..4.73 rows=6 width=27) (actual time=0.003..0.008 rows=8 loops=1,900)

  • Index Cond: ((project_id = 20006) AND (mailing_id = mailings.id) AND (created_time >= '2019-03-10 23:00:00+00'::timestamp with time zone) AND (created_time <= '2019-04-09 21:59:59+00'::timestamp with time zone))
  • Filter: ((deleted IS NOT TRUE) AND (is_unanswered IS NOT TRUE))
  • Rows Removed by Filter: 0
  • Heap Fetches: 73
  • Buffers: shared hit=10628
8.          

SubPlan (forGroupAggregate)

9. 0.484 0.484 ↑ 1.0 1 121

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

  • Index Cond: (id = form_responses.mailing_id)
  • Buffers: shared hit=484
10. 0.242 0.242 ↑ 1.0 1 121

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

  • Index Cond: (id = form_responses.mailing_id)
  • Buffers: shared hit=484
11. 0.242 0.242 ↑ 1.0 1 121

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

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