explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BnzX

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 0.386 ↑ 2.0 2 1

Nested Loop Left Join (cost=9.51..79.56 rows=4 width=15,295) (actual time=0.278..0.386 rows=2 loops=1)

2. 0.008 0.374 ↑ 2.0 2 1

Nested Loop Left Join (cost=9.08..61.74 rows=4 width=15,059) (actual time=0.271..0.374 rows=2 loops=1)

3. 0.010 0.366 ↑ 2.0 2 1

Nested Loop Left Join (cost=8.79..60.28 rows=4 width=14,398) (actual time=0.266..0.366 rows=2 loops=1)

4. 0.009 0.342 ↑ 2.0 2 1

Nested Loop Left Join (cost=8.51..43.03 rows=4 width=13,737) (actual time=0.250..0.342 rows=2 loops=1)

  • Join Filter: (componenti0_.item_id = episodedia35_.component_item_id)
5. 0.006 0.313 ↑ 2.0 2 1

Nested Loop Left Join (cost=8.08..38.53 rows=4 width=13,517) (actual time=0.226..0.313 rows=2 loops=1)

6. 0.007 0.303 ↑ 2.0 2 1

Nested Loop Left Join (cost=7.95..37.91 rows=4 width=13,493) (actual time=0.219..0.303 rows=2 loops=1)

7. 0.005 0.292 ↑ 2.0 2 1

Nested Loop Left Join (cost=7.82..37.28 rows=4 width=13,473) (actual time=0.212..0.292 rows=2 loops=1)

8. 0.005 0.279 ↑ 2.0 2 1

Nested Loop Left Join (cost=7.55..36.06 rows=4 width=13,306) (actual time=0.204..0.279 rows=2 loops=1)

9. 0.008 0.270 ↑ 2.0 2 1

Nested Loop Left Join (cost=7.41..35.14 rows=4 width=13,155) (actual time=0.198..0.270 rows=2 loops=1)

10. 0.008 0.258 ↑ 2.0 2 1

Nested Loop Left Join (cost=7.27..34.46 rows=4 width=13,068) (actual time=0.191..0.258 rows=2 loops=1)

11. 0.005 0.240 ↑ 2.0 2 1

Nested Loop Left Join (cost=6.85..32.60 rows=4 width=12,694) (actual time=0.178..0.240 rows=2 loops=1)

12. 0.004 0.233 ↑ 2.0 2 1

Nested Loop Left Join (cost=6.71..31.94 rows=4 width=12,441) (actual time=0.174..0.233 rows=2 loops=1)

13. 0.005 0.227 ↑ 2.0 2 1

Nested Loop Left Join (cost=6.58..31.29 rows=4 width=12,419) (actual time=0.171..0.227 rows=2 loops=1)

14. 0.003 0.222 ↑ 2.0 2 1

Nested Loop Left Join (cost=6.30..30.07 rows=4 width=12,252) (actual time=0.169..0.222 rows=2 loops=1)

15. 0.004 0.219 ↑ 2.0 2 1

Nested Loop Left Join (cost=6.16..29.42 rows=4 width=12,217) (actual time=0.167..0.219 rows=2 loops=1)

16. 0.005 0.215 ↑ 2.0 2 1

Nested Loop Left Join (cost=6.03..28.78 rows=4 width=12,204) (actual time=0.165..0.215 rows=2 loops=1)

17. 0.002 0.210 ↑ 2.0 2 1

Nested Loop Left Join (cost=5.90..28.15 rows=4 width=12,190) (actual time=0.163..0.210 rows=2 loops=1)

18. 0.002 0.208 ↑ 2.0 2 1

Nested Loop Left Join (cost=5.77..27.33 rows=4 width=11,099) (actual time=0.162..0.208 rows=2 loops=1)

19. 0.002 0.204 ↑ 2.0 2 1

Nested Loop Left Join (cost=5.62..26.64 rows=4 width=10,008) (actual time=0.160..0.204 rows=2 loops=1)

20. 0.004 0.200 ↑ 2.0 2 1

Nested Loop Left Join (cost=5.49..25.99 rows=4 width=8,917) (actual time=0.158..0.200 rows=2 loops=1)

21. 0.004 0.196 ↑ 2.0 2 1

Nested Loop Left Join (cost=5.35..25.34 rows=4 width=8,899) (actual time=0.155..0.196 rows=2 loops=1)

22. 0.002 0.192 ↑ 2.0 2 1

Nested Loop Left Join (cost=5.21..24.68 rows=4 width=8,646) (actual time=0.153..0.192 rows=2 loops=1)

23. 0.003 0.190 ↑ 2.0 2 1

Nested Loop Left Join (cost=4.79..22.63 rows=4 width=8,272) (actual time=0.152..0.190 rows=2 loops=1)

24. 0.005 0.185 ↑ 2.0 2 1

Nested Loop Left Join (cost=4.37..20.76 rows=4 width=6,923) (actual time=0.150..0.185 rows=2 loops=1)

25. 0.005 0.166 ↑ 2.0 2 1

Nested Loop Left Join (cost=3.94..18.83 rows=4 width=6,687) (actual time=0.135..0.166 rows=2 loops=1)

26. 0.002 0.143 ↑ 1.5 2 1

Nested Loop Left Join (cost=3.52..17.32 rows=3 width=6,128) (actual time=0.119..0.143 rows=2 loops=1)

27. 0.005 0.131 ↑ 1.5 2 1

Nested Loop Left Join (cost=3.24..15.08 rows=3 width=5,254) (actual time=0.111..0.131 rows=2 loops=1)

28. 0.001 0.116 ↑ 1.0 2 1

Nested Loop Left Join (cost=2.97..14.36 rows=2 width=5,242) (actual time=0.100..0.116 rows=2 loops=1)

29. 0.004 0.109 ↑ 1.0 2 1

Nested Loop Left Join (cost=2.83..14.03 rows=2 width=5,214) (actual time=0.096..0.109 rows=2 loops=1)

30. 0.004 0.097 ↑ 1.0 2 1

Nested Loop Left Join (cost=2.55..13.32 rows=2 width=5,047) (actual time=0.088..0.097 rows=2 loops=1)

31. 0.004 0.091 ↑ 1.0 2 1

Nested Loop Left Join (cost=2.42..12.99 rows=2 width=4,798) (actual time=0.085..0.091 rows=2 loops=1)

32. 0.002 0.080 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.14..12.60 rows=1 width=4,786) (actual time=0.075..0.080 rows=1 loops=1)

33. 0.003 0.072 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.86..10.08 rows=1 width=4,619) (actual time=0.068..0.072 rows=1 loops=1)

34. 0.000 0.064 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.72..9.91 rows=1 width=4,366) (actual time=0.062..0.064 rows=1 loops=1)

35. 0.001 0.058 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.57..9.73 rows=1 width=3,266) (actual time=0.056..0.058 rows=1 loops=1)

36. 0.001 0.049 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.30..9.43 rows=1 width=2,927) (actual time=0.048..0.049 rows=1 loops=1)

37. 0.004 0.037 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.87..8.91 rows=1 width=1,754) (actual time=0.036..0.037 rows=1 loops=1)

38. 0.015 0.015 ↑ 1.0 1 1

Index Scan using trx_cd_component_item_pkey on trx_cd_component_item componenti0_ (cost=0.43..4.45 rows=1 width=1,606) (actual time=0.015..0.015 rows=1 loops=1)

  • Index Cond: (item_id = 1000006138580::bigint)
39. 0.018 0.018 ↑ 1.0 1 1

Index Scan using trx_cd_component_pkey on trx_cd_component component1_ (cost=0.43..4.45 rows=1 width=148) (actual time=0.017..0.018 rows=1 loops=1)

  • Index Cond: (componenti0_.component_id = component_id)
40. 0.011 0.011 ↑ 1.0 1 1

Index Scan using trx_pm_visit_encounter_pkey on trx_pm_visit_encounter visitencou2_ (cost=0.43..0.50 rows=1 width=1,173) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: (component1_.visit_encounter_id = visit_encounter_id)
41. 0.008 0.008 ↑ 1.0 1 1

Index Scan using mst_am_user_pkey on mst_am_user user3_ (cost=0.28..0.30 rows=1 width=339) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (visitencou2_.user_id = user_id)
42. 0.006 0.006 ↑ 1.0 1 1

Index Scan using mst_am_designation_pkey on mst_am_designation designatio4_ (cost=0.15..0.17 rows=1 width=1,100) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (user3_.designation_id = designation_id)
43. 0.005 0.005 ↑ 1.0 1 1

Index Scan using mst_am_facility_pkey on mst_am_facility healthfaci5_ (cost=0.14..0.16 rows=1 width=253) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: (user3_.facility_id = facility_id)
44. 0.006 0.006 ↑ 1.0 1 1

Index Scan using ref_am_simple_list_config_pkey on ref_am_simple_list_config simplelist6_ (cost=0.28..2.51 rows=1 width=167) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (healthfaci5_.facility_type_id = simple_list_config_id)
45. 0.007 0.007 ↑ 1.5 2 1

Index Only Scan using mst_am_user__facility_pkey on mst_am_user__facility facilityli7_ (cost=0.28..0.36 rows=3 width=12) (actual time=0.007..0.007 rows=2 loops=1)

  • Index Cond: (user_id = user3_.user_id)
  • Heap Fetches: 0
46. 0.002 0.002 ↑ 1.0 1 2

Index Scan using mst_am_facility_pkey on mst_am_facility healthfaci8_ (cost=0.14..0.16 rows=1 width=253) (actual time=0.001..0.001 rows=1 loops=2)

  • Index Cond: (facilityli7_.facility_id = facility_id)
47. 0.008 0.008 ↑ 1.0 1 2

Index Scan using ref_am_simple_list_config_pkey on ref_am_simple_list_config simplelist9_ (cost=0.28..0.35 rows=1 width=167) (actual time=0.004..0.004 rows=1 loops=2)

  • Index Cond: (user3_.grade_id = simple_list_config_id)
48. 0.006 0.006 ↑ 1.0 1 2

Index Scan using ref_co_identity_type_pkey on ref_co_identity_type identityty10_ (cost=0.14..0.16 rows=1 width=28) (actual time=0.002..0.003 rows=1 loops=2)

  • Index Cond: (user3_.identity_type_id = identity_type_id)
49. 0.010 0.010 ↑ 2.0 1 2

Index Only Scan using mst_am_user__role_pkey on mst_am_user__role rolelist11_ (cost=0.28..0.34 rows=2 width=12) (actual time=0.004..0.005 rows=1 loops=2)

  • Index Cond: (user_id = user3_.user_id)
  • Heap Fetches: 0
50. 0.010 0.010 ↑ 1.0 1 2

Index Scan using mst_am_role_pkey on mst_am_role role12_ (cost=0.28..0.74 rows=1 width=878) (actual time=0.004..0.005 rows=1 loops=2)

  • Index Cond: (rolelist11_.role_id = role_id)
51. 0.004 0.018 ↑ 1.0 1 2

Nested Loop Left Join (cost=0.42..0.49 rows=1 width=559) (actual time=0.009..0.009 rows=1 loops=2)

52. 0.010 0.010 ↑ 1.0 1 2

Index Only Scan using mst_am_role__security_group_pkey on mst_am_role__security_group securitygr13_ (cost=0.28..0.31 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=2)

  • Index Cond: (role_id = role12_.role_id)
  • Heap Fetches: 0
53. 0.004 0.004 ↑ 1.0 1 2

Index Scan using mst_am_security_group_pkey on mst_am_security_group securitygr14_ (cost=0.14..0.18 rows=1 width=555) (actual time=0.002..0.002 rows=1 loops=2)

  • Index Cond: (securitygr13_.security_group_id = security_group_id)
54. 0.014 0.014 ↑ 1.0 1 2

Index Scan using trx_pm_patient_visit_visit_id_idx on trx_pm_patient_visit patientvis15_ (cost=0.43..0.47 rows=1 width=236) (actual time=0.007..0.007 rows=1 loops=2)

  • Index Cond: (visitencou2_.visit_id = visit_id)
55. 0.002 0.002 ↓ 0.0 0 2

Index Scan using mst_pm_appointment_pkey on mst_pm_appointment appointmen16_ (cost=0.42..0.46 rows=1 width=1,349) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (patientvis15_.appointment_id = appointment_id)
56. 0.000 0.000 ↓ 0.0 0 2

Index Scan using mst_pm_patient_patient_id_idx on mst_pm_patient patient17_ (cost=0.42..0.50 rows=1 width=374) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (appointmen16_.patient_id = patient_id)
57. 0.000 0.000 ↓ 0.0 0 2

Index Scan using mst_am_facility_pkey on mst_am_facility healthfaci18_ (cost=0.14..0.16 rows=1 width=253) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (patient17_.clinic_id = facility_id)
58. 0.000 0.000 ↓ 0.0 0 2

Index Scan using ref_co_education_level_pkey on ref_co_education_level educationl19_ (cost=0.14..0.15 rows=1 width=18) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (patient17_.education_level_education_level_id = education_level_id)
59. 0.002 0.002 ↓ 0.0 0 2

Index Scan using ref_co_ethnic_group_pkey on ref_co_ethnic_group ethnicgrou20_ (cost=0.14..0.15 rows=1 width=1,091) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (patient17_.ethnic_group_ethnic_group_id = ethnic_group_id)
60. 0.002 0.002 ↓ 0.0 0 2

Index Scan using ref_co_sub_ethnic_group_pkey on ref_co_sub_ethnic_group ethnicsubg21_ (cost=0.14..0.16 rows=1 width=1,091) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (patient17_.ethnic_sub_group_sub_ethnic_group_id = sub_ethnic_group_id)
61. 0.000 0.000 ↓ 0.0 0 2

Index Scan using ref_co_ethnic_group_pkey on ref_co_ethnic_group ethnicgrou22_ (cost=0.14..0.19 rows=1 width=1,091) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (ethnicsubg21_.ethnic_group_id = ethnic_group_id)
62. 0.000 0.000 ↓ 0.0 0 2

Index Scan using ref_co_gender_pkey on ref_co_gender gender23_ (cost=0.13..0.15 rows=1 width=14) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (patient17_.gender_gender_id = gender_id)
63. 0.000 0.000 ↓ 0.0 0 2

Index Scan using ref_co_marital_status_pkey on ref_co_marital_status maritalsta24_ (cost=0.13..0.15 rows=1 width=13) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (patient17_.marital_status_marital_status_id = marital_status_id)
64. 0.000 0.000 ↓ 0.0 0 2

Index Scan using ref_co_occupation_pkey on ref_co_occupation occupation25_ (cost=0.14..0.15 rows=1 width=35) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (patient17_.occupation_occupation_id = occupation_id)
65. 0.000 0.000 ↓ 0.0 0 2

Index Scan using ref_am_simple_list_config_pkey on ref_am_simple_list_config simplelist26_ (cost=0.28..0.30 rows=1 width=167) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (patient17_.profile_id = simple_list_config_id)
66. 0.002 0.002 ↓ 0.0 0 2

Index Scan using ref_co_religion_pkey on ref_co_religion religion27_ (cost=0.14..0.15 rows=1 width=22) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (patient17_.religion_religion_id = religion_id)
67. 0.002 0.002 ↑ 1.0 1 2

Index Scan using mst_am_facility_pkey on mst_am_facility healthfaci28_ (cost=0.14..0.16 rows=1 width=253) (actual time=0.001..0.001 rows=1 loops=2)

  • Index Cond: (patientvis15_.clinic_id = facility_id)
68. 0.010 0.010 ↑ 1.0 1 2

Index Scan using mst_pm_patient_patient_id_idx on mst_pm_patient patient29_ (cost=0.42..0.45 rows=1 width=374) (actual time=0.005..0.005 rows=1 loops=2)

  • Index Cond: (patientvis15_.patient_id = patient_id)
69. 0.004 0.004 ↑ 1.0 1 2

Index Scan using ref_pm_service_pkey on ref_pm_service service30_ (cost=0.14..0.16 rows=1 width=87) (actual time=0.002..0.002 rows=1 loops=2)

  • Index Cond: (patientvis15_.service_id = service_id)
70. 0.004 0.004 ↑ 1.0 1 2

Index Scan using mst_am_discipline_pkey on mst_am_discipline discipline31_ (cost=0.13..0.22 rows=1 width=151) (actual time=0.002..0.002 rows=1 loops=2)

  • Index Cond: (service30_.discipline = discipline_id)
71. 0.008 0.008 ↑ 1.0 1 2

Index Scan using ref_am_simple_list_config_pkey on ref_am_simple_list_config simplelist32_ (cost=0.28..0.30 rows=1 width=167) (actual time=0.003..0.004 rows=1 loops=2)

  • Index Cond: (patientvis15_.visit_location_id = simple_list_config_id)
72. 0.004 0.004 ↑ 1.0 1 2

Index Scan using ref_pm_visit_record_status_pkey on ref_pm_visit_record_status visitrecor33_ (cost=0.13..0.15 rows=1 width=20) (actual time=0.002..0.002 rows=1 loops=2)

  • Index Cond: (patientvis15_.visit_records_status_id = visit_record_status_id)
73. 0.004 0.004 ↑ 1.0 1 2

Index Scan using ref_pm_visit_type_pkey on ref_pm_visit_type visittype34_ (cost=0.13..0.15 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=2)

  • Index Cond: (patientvis15_.visit_type_id = visit_type_id)
74. 0.006 0.020 ↑ 1.0 1 2

Materialize (cost=0.42..4.45 rows=1 width=220) (actual time=0.009..0.010 rows=1 loops=2)

75. 0.014 0.014 ↑ 1.0 1 1

Index Scan using trx_cd_episode_diagnosis_component_item_id_idx on trx_cd_episode_diagnosis episodedia35_ (cost=0.42..4.44 rows=1 width=220) (actual time=0.014..0.014 rows=1 loops=1)

  • Index Cond: (component_item_id = 1000006138580::bigint)
76. 0.014 0.014 ↑ 1.0 1 2

Index Scan using ref_cd_diagnosis_code_pkey on ref_cd_diagnosis_code diagnosisc36_ (cost=0.29..4.30 rows=1 width=661) (actual time=0.007..0.007 rows=1 loops=2)

  • Index Cond: ((episodedia35_.diagnosis_code)::text = (code)::text)
77. 0.000 0.000 ↓ 0.0 0 2

Index Scan using ref_cd_diagnosis_code_pkey on ref_cd_diagnosis_code diagnosisc37_ (cost=0.29..0.35 rows=1 width=661) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: ((diagnosisc36_.parent)::text = (code)::text)
78. 0.006 0.006 ↑ 1.0 1 2

Index Scan using trx_pm_patient_visit_visit_id_idx on trx_pm_patient_visit patientvis38_ (cost=0.43..4.45 rows=1 width=236) (actual time=0.003..0.003 rows=1 loops=2)

  • Index Cond: (episodedia35_.patient_visit_id = visit_id)