explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DS8Y

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.058 1,061.130 ↓ 1.5 64 1

Nested Loop (cost=151.65..350.69 rows=43 width=398) (actual time=115.495..1,061.130 rows=64 loops=1)

2. 0.003 1,061.008 ↓ 1.5 64 1

Nested Loop (cost=151.50..343.10 rows=43 width=106) (actual time=115.473..1,061.008 rows=64 loops=1)

3. 0.021 1,060.877 ↓ 1.5 64 1

Nested Loop (cost=151.22..328.33 rows=43 width=70) (actual time=115.467..1,060.877 rows=64 loops=1)

4. 0.035 1,060.728 ↓ 1.5 64 1

Merge Right Join (cost=150.93..312.76 rows=43 width=50) (actual time=115.462..1,060.728 rows=64 loops=1)

  • Merge Cond: (sdr.survey_distribution_id = sd.id)
5. 0.031 1,060.276 ↑ 20.9 20 1

Nested Loop (cost=0.69..67,714.50 rows=419 width=37) (actual time=31.972..1,060.276 rows=20 loops=1)

6. 53.589 1,060.185 ↑ 20.9 20 1

Index Scan using sdr_id_created_at on survey_distribution_result sdr (cost=0.42..67,527.75 rows=419 width=20) (actual time=31.967..1,060.185 rows=20 loops=1)

  • Filter: (created_at = (SubPlan 2))
  • Rows Removed by Filter: 83863
7.          

SubPlan (forIndex Scan)

8. 0.000 1,006.596 ↑ 1.0 1 83,883

Result (cost=0.72..0.73 rows=1 width=0) (actual time=0.012..0.012 rows=1 loops=83,883)

9.          

Initplan (forResult)

10. 83.883 1,006.596 ↑ 1.0 1 83,883

Limit (cost=0.29..0.72 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=83,883)

11. 922.713 922.713 ↑ 9,321.0 1 83,883

Index Scan Backward using sdr_created_at on survey_distribution_result sdr2 (cost=0.29..4,018.21 rows=9,321 width=8) (actual time=0.011..0.011 rows=1 loops=83,883)

  • Index Cond: (created_at IS NOT NULL)
  • Filter: (survey_distribution_id = sdr.survey_distribution_id)
  • Rows Removed by Filter: 24
12. 0.060 0.060 ↑ 1.0 1 20

Index Scan using mr_pkey on mr m_1 (cost=0.28..0.44 rows=1 width=25) (actual time=0.003..0.003 rows=1 loops=20)

  • Index Cond: (id = sdr.submitter_id)
13. 0.036 0.417 ↓ 1.5 64 1

Sort (cost=150.24..150.34 rows=43 width=17) (actual time=0.404..0.417 rows=64 loops=1)

  • Sort Key: sd.id
  • Sort Method: quicksort Memory: 30kB
14. 0.043 0.381 ↓ 1.5 64 1

Nested Loop (cost=5.19..149.07 rows=43 width=17) (actual time=0.046..0.381 rows=64 loops=1)

15. 0.012 0.146 ↓ 1.5 64 1

Nested Loop (cost=4.90..134.26 rows=43 width=4) (actual time=0.040..0.146 rows=64 loops=1)

16. 0.011 0.011 ↑ 1.0 1 1

Index Scan using unq_cwid on mr m (cost=0.28..8.29 rows=1 width=4) (actual time=0.010..0.011 rows=1 loops=1)

  • Index Cond: ((cwid)::text = 'GFXTL'::text)
17. 0.108 0.123 ↓ 1.5 64 1

Bitmap Heap Scan on survey_distribution_mr sdm (cost=4.62..125.54 rows=43 width=8) (actual time=0.025..0.123 rows=64 loops=1)

  • Recheck Cond: (mr_id = m.id)
  • Heap Blocks: exact=62
18. 0.015 0.015 ↓ 1.5 64 1

Bitmap Index Scan on survey_distribution_mr_mr_id_survey_distribution_id_key (cost=0.00..4.61 rows=43 width=0) (actual time=0.015..0.015 rows=64 loops=1)

  • Index Cond: (mr_id = m.id)
19. 0.192 0.192 ↑ 1.0 1 64

Index Scan using survey_distribution_pkey on survey_distribution sd (cost=0.29..0.33 rows=1 width=17) (actual time=0.003..0.003 rows=1 loops=64)

  • Index Cond: (id = sdm.survey_distribution_id)
20. 0.128 0.128 ↑ 1.0 1 64

Index Scan using dr_pkey on dr d (cost=0.29..0.35 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=64)

  • Index Cond: (id = sd.dr_id)
21. 0.128 0.128 ↑ 1.0 1 64

Index Scan using institution_pkey on institution i (cost=0.29..0.33 rows=1 width=40) (actual time=0.001..0.002 rows=1 loops=64)

  • Index Cond: (id = sd.institution_id)
22. 0.064 0.064 ↑ 1.0 1 64

Index Scan using survey_pkey on survey su (cost=0.14..0.16 rows=1 width=296) (actual time=0.001..0.001 rows=1 loops=64)

  • Index Cond: (id = sd.survey_id)