explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mwxK : 1

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 50,061.708 ↑ 5.5 2 1

Limit (cost=9,058,835.61..9,068,160.42 rows=11 width=4) (actual time=50,061.680..50,061.708 rows=2 loops=1)

  • Buffers: shared hit=1501970
2. 8.642 50,061.705 ↑ 34.5 2 1

Nested Loop Left Join (cost=9,058,835.61..9,117,327.59 rows=69 width=4) (actual time=50,061.678..50,061.705 rows=2 loops=1)

  • Filter: (mc.closing_step_id IS NULL)
  • Rows Removed by Filter: 7840
  • Buffers: shared hit=1501970
3. 3.026 50,029.537 ↓ 2.3 7,842 1

Nested Loop Left Join (cost=9,058,835.04..9,088,313.09 rows=3,400 width=8) (actual time=49,971.503..50,029.537 rows=7,842 loops=1)

  • Buffers: shared hit=1462707
4. 6.833 49,987.301 ↓ 2.3 7,842 1

Merge Left Join (cost=9,058,834.61..9,060,329.09 rows=3,400 width=16) (actual time=49,971.482..49,987.301 rows=7,842 loops=1)

  • Merge Cond: (mep.id = mea.event_patient_id)
  • Filter: ((mea.denial IS NULL) OR (mea.denial IS FALSE))
  • Buffers: shared hit=1431275
5. 1.599 49,969.447 ↓ 2.3 7,842 1

Merge Left Join (cost=9,058,834.32..9,058,853.62 rows=3,400 width=16) (actual time=49,966.131..49,969.447 rows=7,842 loops=1)

  • Merge Cond: (mep.id = mdoa.event_patient_id)
  • Buffers: shared hit=1420697
6. 15.202 49,967.840 ↓ 2.3 7,842 1

Sort (cost=9,058,800.60..9,058,809.10 rows=3,400 width=16) (actual time=49,966.119..49,967.840 rows=7,842 loops=1)

  • Sort Key: mep.id
  • Sort Method: quicksort Memory: 560kB
  • Buffers: shared hit=1420697
7. 6.518 49,952.638 ↓ 2.3 7,842 1

Nested Loop (cost=0.42..9,058,601.17 rows=3,400 width=16) (actual time=0.154..49,952.638 rows=7,842 loops=1)

  • Buffers: shared hit=1420697
8. 0.091 0.091 ↑ 1.0 1 1

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

  • Filter: (id = 1436)
  • Rows Removed by Filter: 329
  • Buffers: shared hit=7
9. 56.706 49,946.029 ↓ 2.3 7,842 1

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 time=0.065..49,946.029 rows=7,842 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: 286
  • Buffers: shared hit=1420690
10.          

SubPlan (forIndex Scan)

11. 20,062.394 49,889.323 ↓ 0.0 0 7,843

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

  • Merge Cond: (ref.service_id = msr.id)
  • Buffers: shared hit=1420170
12. 29,544.581 29,544.581 ↑ 51.1 32,911 7,843

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 time=0.010..3.767 rows=32,911 loops=7,843)

  • Heap Fetches: 3652879
  • Buffers: shared hit=1368695
13. 101.959 282.348 ↑ 104.7 6 7,843

Sort (cost=84.52..86.09 rows=628 width=4) (actual time=0.034..0.036 rows=6 loops=7,843)

  • Sort Key: msr.id
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=51475
14. 180.389 180.389 ↑ 104.7 6 7,843

Index Scan using md_srv_rendered_case_id_idx on md_srv_rendered msr (cost=0.57..55.33 rows=628 width=4) (actual time=0.017..0.023 rows=6 loops=7,843)

  • Index Cond: (case_id = mep.case_id)
  • Buffers: shared hit=51475
15. 0.007 0.008 ↓ 0.0 0 1

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

  • Sort Key: mdoa.event_patient_id
  • Sort Method: quicksort Memory: 25kB
16. 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)

17. 11.021 11.021 ↓ 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.015..11.021 rows=32,868 loops=1)

  • Buffers: shared hit=10578
18. 39.210 39.210 ↑ 1.0 1 7,842

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

  • Index Cond: (id = mep.indiv_id)
  • Buffers: shared hit=31432
19. 23.526 23.526 ↑ 1.0 1 7,842

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

  • Index Cond: (id = mep.case_id)
  • Buffers: shared hit=39263
Planning time : 2.802 ms
Execution time : 50,061.953 ms