explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1Yed : 1

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=9,058,836.04..9,068,161.12 rows=11 width=8) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=9,058,836.04..9,117,329.71 rows=69 width=8) (actual rows= loops=)

  • Join Filter: (addr.party_id = i.id)
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=9,058,835.61..9,117,327.59 rows=69 width=12) (actual rows= loops=)

  • Filter: (mc.closing_step_id IS NULL)
4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=9,058,835.04..9,088,313.09 rows=3,400 width=12) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=9,058,834.61..9,060,329.09 rows=3,400 width=16) (actual rows= loops=)

  • Merge Cond: (mep.id = mea.event_patient_id)
  • Filter: ((mea.denial IS NULL) OR (mea.denial IS FALSE))
6. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=9,058,834.32..9,058,853.62 rows=3,400 width=16) (actual rows= loops=)

  • Merge Cond: (mep.id = mdoa.event_patient_id)
7. 0.000 0.000 ↓ 0.0

Sort (cost=9,058,800.60..9,058,809.10 rows=3,400 width=16) (actual rows= loops=)

  • Sort Key: mep.id
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..9,058,601.17 rows=3,400 width=16) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

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

  • Filter: (id = 1436)
10. 0.000 0.000 ↓ 0.0

Index Scan using idx_md_event_patient on md_event_patient mep (cost=0.42..9,058,556.05 rows=3,400 width=20) (actual rows= loops=)

  • Index Cond: (event_id = 1436)
  • Filter: ((is_deleted IS NOT TRUE) AND (case_id_2stage IS NULL) AND ((SubPlan 2) IS NOT TRUE))
11.          

SubPlan (forIndex Scan)

12. 0.000 0.000 ↓ 0.0

Merge Join (cost=85.07..1,115.59 rows=1 width=0) (actual rows= loops=)

  • Merge Cond: (ref.service_id = msr.id)
13. 0.000 0.000 ↓ 0.0

Index Only Scan using md_referral_to_service_fk on md_referral ref (cost=0.43..43,890.82 rows=1,680,426 width=4) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Sort (cost=84.52..86.09 rows=628 width=4) (actual rows= loops=)

  • Sort Key: msr.id
15. 0.000 0.000 ↓ 0.0

Index Scan using md_srv_rendered_case_id_idx on md_srv_rendered msr (cost=0.57..55.33 rows=628 width=4) (actual rows= loops=)

  • Index Cond: (case_id = mep.case_id)
16. 0.000 0.000 ↓ 0.0

Sort (cost=33.72..34.82 rows=440 width=8) (actual rows= loops=)

  • Sort Key: mdoa.event_patient_id
17. 0.000 0.000 ↓ 0.0

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

18. 0.000 0.000 ↓ 0.0

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 rows= loops=)

19. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (id = mep.indiv_id)
20. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (id = mep.case_id)
21. 0.000 0.000 ↓ 0.0

Materialize (cost=0.43..1.09 rows=1 width=4) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Subquery Scan on addr (cost=0.43..1.09 rows=1 width=4) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Limit (cost=0.43..1.08 rows=1 width=4) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..4,580,625.01 rows=7,102,805 width=4) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..1,266,200.71 rows=7,102,805 width=4) (actual rows= loops=)

  • Join Filter: (ppatat.address_type_id = pat.id)
26. 0.000 0.000 ↓ 0.0

Seq Scan on pim_address_type pat (cost=0.00..1.07 rows=1 width=4) (actual rows= loops=)

  • Filter: ((code)::text = 'ACTUAL'::text)
27. 0.000 0.000 ↓ 0.0

Seq Scan on pim_party_addr_to_addr_type ppatat (cost=0.00..733,489.28 rows=42,616,828 width=8) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Index Scan using pim_party_address_pk on pim_party_address ppa (cost=0.43..0.46 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (id = ppatat.party_address_id)