explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DKJv

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 50.135 ↑ 5.5 2 1

Limit (cost=7,800.85..17,125.66 rows=11 width=4) (actual time=50.113..50.135 rows=2 loops=1)

  • Buffers: shared hit=50364
2. 0.005 50.133 ↑ 34.5 2 1

Nested Loop Left Join (cost=7,800.85..66,292.83 rows=69 width=4) (actual time=50.111..50.133 rows=2 loops=1)

  • Filter: (mc.closing_step_id IS NULL)
  • Buffers: shared hit=50364
3. 0.005 50.110 ↑ 1,700.0 2 1

Nested Loop Left Join (cost=7,800.29..37,278.33 rows=3,400 width=8) (actual time=50.093..50.110 rows=2 loops=1)

  • Buffers: shared hit=50354
4. 3.238 50.081 ↑ 1,700.0 2 1

Merge Left Join (cost=7,799.86..9,294.33 rows=3,400 width=16) (actual time=50.073..50.081 rows=2 loops=1)

  • Merge Cond: (mep.id = mea.event_patient_id)
  • Filter: ((mea.denial IS NULL) OR (mea.denial IS FALSE))
  • Buffers: shared hit=50346
5. 0.025 37.524 ↑ 1,700.0 2 1

Merge Left Join (cost=7,799.57..7,818.87 rows=3,400 width=16) (actual time=37.522..37.524 rows=2 loops=1)

  • Merge Cond: (mep.id = mdoa.event_patient_id)
  • Buffers: shared hit=39768
6. 0.009 37.484 ↑ 1,700.0 2 1

Sort (cost=7,765.85..7,774.35 rows=3,400 width=16) (actual time=37.483..37.484 rows=2 loops=1)

  • Sort Key: mep.id
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=39768
7. 0.005 37.475 ↑ 1,700.0 2 1

Nested Loop (cost=0.42..7,566.42 rows=3,400 width=16) (actual time=0.084..37.475 rows=2 loops=1)

  • Buffers: shared hit=39768
8. 0.056 0.056 ↑ 1.0 1 1

Seq Scan on md_event me (cost=0.00..11.12 rows=1 width=12) (actual time=0.052..0.056 rows=1 loops=1)

  • Filter: (id = 1436)
  • Rows Removed by Filter: 329
  • Buffers: shared hit=7
9. 6.042 37.414 ↑ 1,700.0 2 1

Index Scan using idx_md_event_patient on md_event_patient mep (cost=0.42..7,521.29 rows=3,400 width=20) (actual time=0.029..37.414 rows=2 loops=1)

  • Index Cond: (event_id = 1436)
  • Filter: ((is_deleted IS NOT TRUE) AND (case_id_2stage IS NULL) AND ((SubPlan 2) IS NOT TRUE))
  • Rows Removed by Filter: 8126
  • Buffers: shared hit=39761
10.          

SubPlan (forIndex Scan)

11. 31.372 31.372 ↑ 613.0 1 7,843

Index Scan using md_srv_rendered_case_id_idx on md_srv_rendered msr (cost=0.57..55.33 rows=613 width=0) (actual time=0.004..0.004 rows=1 loops=7,843)

  • Index Cond: (case_id = mep.case_id)
  • Filter: (referral_id IS NULL)
  • Buffers: shared hit=39241
12. 0.014 0.015 ↓ 0.0 0 1

Sort (cost=33.72..34.82 rows=440 width=8) (actual time=0.015..0.015 rows=0 loops=1)

  • Sort Key: mdoa.event_patient_id
  • Sort Method: quicksort Memory: 25kB
13. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on md_disp_orphans_absence mdoa (cost=0.00..14.40 rows=440 width=8) (actual time=0.001..0.001 rows=0 loops=1)

14. 9.319 9.319 ↓ 1.0 32,868 1

Index Scan using md_event_agreement_ep_key on md_event_agreement mea (cost=0.29..1,377.87 rows=32,858 width=5) (actual time=0.013..9.319 rows=32,868 loops=1)

  • Buffers: shared hit=10578
15. 0.024 0.024 ↑ 1.0 1 2

Index Scan using pim_individual_pk on pim_individual i (cost=0.43..8.22 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=2)

  • Index Cond: (id = mep.indiv_id)
  • Buffers: shared hit=8
16. 0.018 0.018 ↑ 1.0 1 2

Index Scan using mc_case_pk on mc_case mc (cost=0.56..8.52 rows=1 width=8) (actual time=0.008..0.009 rows=1 loops=2)

  • Index Cond: (id = mep.case_id)
  • Buffers: shared hit=10
Planning time : 2.744 ms
Execution time : 50.289 ms