explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ivJ6

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 2,814.321 ↑ 880.0 1 1

Sort (cost=208,065.64..208,067.84 rows=880 width=1,856) (actual time=2,814.321..2,814.321 rows=1 loops=1)

  • Sort Key: pp.procedure_performed_id
  • Sort Method: quicksort Memory: 26kB
2.          

CTE tt

3. 56.246 342.262 ↑ 1.0 157,321 1

Hash Left Join (cost=6,494.20..20,124.75 rows=157,321 width=654) (actual time=82.230..342.262 rows=157,321 loops=1)

  • Hash Cond: (t_aux.schedule_id = s_1.schedule_id)
4. 155.596 286.012 ↑ 1.0 157,321 1

Hash Right Join (cost=6,481.72..18,126.10 rows=157,321 width=90) (actual time=82.212..286.012 rows=157,321 loops=1)

  • Hash Cond: (r.request_id = t_aux.request_id)
5. 48.340 48.340 ↑ 1.0 157,321 1

Seq Scan on request r (cost=0.00..4,716.21 rows=157,321 width=74) (actual time=0.010..48.340 rows=157,321 loops=1)

6. 40.243 82.076 ↑ 1.0 157,321 1

Hash (cost=3,746.21..3,746.21 rows=157,321 width=16) (actual time=82.076..82.076 rows=157,321 loops=1)

  • Buckets: 131,072 Batches: 4 Memory Usage: 2,712kB
7. 41.833 41.833 ↑ 1.0 157,321 1

Seq Scan on treatment t_aux (cost=0.00..3,746.21 rows=157,321 width=16) (actual time=0.019..41.833 rows=157,321 loops=1)

8. 0.001 0.004 ↓ 0.0 0 1

Hash (cost=11.10..11.10 rows=110 width=614) (actual time=0.004..0.004 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
9. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on schedule s_1 (cost=0.00..11.10 rows=110 width=614) (actual time=0.003..0.003 rows=0 loops=1)

10. 0.064 2,814.311 ↑ 880.0 1 1

Hash Left Join (cost=175,245.68..187,897.85 rows=880 width=1,856) (actual time=2,814.308..2,814.311 rows=1 loops=1)

  • Hash Cond: (tt.profession_id = rhpprof.profession_id)
11. 0.003 2,812.517 ↑ 880.0 1 1

Nested Loop Left Join (cost=175,080.75..187,589.81 rows=880 width=1,545) (actual time=2,812.515..2,812.517 rows=1 loops=1)

12. 0.009 2,812.509 ↑ 880.0 1 1

Hash Left Join (cost=175,080.33..184,629.71 rows=880 width=1,523) (actual time=2,812.508..2,812.509 rows=1 loops=1)

  • Hash Cond: (tt.health_professional_id = rhp.health_professional_id)
13. 0.008 2,811.856 ↑ 880.0 1 1

Hash Left Join (cost=175,010.65..184,548.92 rows=880 width=1,519) (actual time=2,811.854..2,811.856 rows=1 loops=1)

  • Hash Cond: (tt.health_facility_id = rhf.health_facility_id)
14. 0.011 2,811.771 ↑ 880.0 1 1

Hash Left Join (cost=175,001.39..184,528.59 rows=880 width=1,487) (actual time=2,811.770..2,811.771 rows=1 loops=1)

  • Hash Cond: (pp.repassed_by = rep_u.user_id)
15. 1.628 2,810.686 ↑ 880.0 1 1

Merge Left Join (cost=172,281.33..181,805.21 rows=880 width=1,465) (actual time=2,810.686..2,810.686 rows=1 loops=1)

  • Merge Cond: (t.treatment_id = thhp.treatment_id)
16. 0.011 2,555.997 ↑ 880.0 1 1

Sort (cost=142,867.28..142,869.48 rows=880 width=1,360) (actual time=2,555.997..2,555.997 rows=1 loops=1)

  • Sort Key: t.treatment_id
  • Sort Method: quicksort Memory: 25kB
17. 0.008 2,555.986 ↑ 880.0 1 1

Hash Left Join (cost=70,148.69..142,824.24 rows=880 width=1,360) (actual time=2,447.637..2,555.986 rows=1 loops=1)

  • Hash Cond: ((tt.patient_id = phhicp.patient_id) AND (tt.health_insurance_company_id = phhicp.health_insurance_company_id) AND (tt.health_insurance_company_plan_id = phhicp.health_insurance_company_plan_id))
18. 0.006 2,555.959 ↑ 880.0 1 1

Hash Left Join (cost=70,140.24..142,800.06 rows=880 width=1,348) (actual time=2,447.611..2,555.959 rows=1 loops=1)

  • Hash Cond: ((tt.health_insurance_company_id = hicp.health_insurance_company_id) AND (tt.health_insurance_company_plan_id = hicp.health_insurance_company_plan_id))
19. 0.006 2,555.903 ↑ 880.0 1 1

Hash Left Join (cost=70,134.66..142,781.06 rows=880 width=1,329) (actual time=2,447.554..2,555.903 rows=1 loops=1)

  • Hash Cond: (tt.health_insurance_company_id = hic.health_insurance_company_id)
20. 0.010 2,555.870 ↑ 880.0 1 1

Hash Left Join (cost=70,132.31..142,767.64 rows=880 width=1,310) (actual time=2,447.522..2,555.870 rows=1 loops=1)

  • Hash Cond: (tt.patient_id = p.patient_id)
21. 0.018 2,555.845 ↑ 880.0 1 1

Hash Left Join (cost=70,115.43..142,738.66 rows=880 width=1,284) (actual time=2,447.498..2,555.845 rows=1 loops=1)

  • Hash Cond: (tt.created_by = ttu.user_id)
22. 0.011 2,554.637 ↑ 880.0 1 1

Hash Left Join (cost=67,395.37..140,006.49 rows=880 width=1,258) (actual time=2,446.290..2,554.637 rows=1 loops=1)

  • Hash Cond: ((rhpp.gloss_over_code)::text = (it38.code)::text)
23. 0.016 2,554.422 ↑ 880.0 1 1

Hash Left Join (cost=67,374.71..139,974.73 rows=880 width=1,203) (actual time=2,446.076..2,554.422 rows=1 loops=1)

  • Hash Cond: ((rec.recourse_id = rhpp.recourse_id) AND (pp.procedure_performed_id = rhpp.procedure_performed_id))
24. 0.011 2,550.558 ↑ 880.0 1 1

Hash Left Join (cost=67,026.98..139,616.00 rows=880 width=1,100) (actual time=2,442.213..2,550.558 rows=1 loops=1)

  • Hash Cond: (lot_map.recourse_id = rec.recourse_id)
25. 0.019 2,550.517 ↑ 880.0 1 1

Hash Left Join (cost=67,023.25..139,601.15 rows=880 width=1,100) (actual time=2,442.173..2,550.517 rows=1 loops=1)

  • Hash Cond: (lot_map.sadt_lot_id = sl.sadt_lot_id)
26. 0.023 2,547.948 ↑ 880.0 1 1

Hash Left Join (cost=66,738.58..139,305.37 rows=880 width=1,088) (actual time=2,439.604..2,547.948 rows=1 loops=1)

  • Hash Cond: (lot_map_aux.root_id = lot_map.sadt_lot_id)
27. 0.006 2,545.438 ↑ 880.0 1 1

Nested Loop Left Join (cost=66,471.92..139,027.61 rows=880 width=1,080) (actual time=2,437.095..2,545.438 rows=1 loops=1)

28. 20.090 2,545.425 ↑ 880.0 1 1

Hash Join (cost=66,471.64..138,760.81 rows=880 width=1,080) (actual time=2,437.083..2,545.425 rows=1 loops=1)

  • Hash Cond: (t.treatment_id = tt.treatment_id)
29. 274.343 2,063.549 ↑ 1.0 175,984 1

Gather (cost=62,922.08..117,384.07 rows=175,984 width=954) (actual time=1,212.675..2,063.549 rows=175,984 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
30. 28.982 1,789.206 ↑ 1.3 58,661 3 / 3

Hash Left Join (cost=61,922.08..98,785.67 rows=73,327 width=954) (actual time=1,216.334..1,789.206 rows=58,661 loops=3)

  • Hash Cond: (t.treatment_status_id = ts.treatment_status_id)
31. 23.881 1,760.203 ↑ 1.3 58,661 3 / 3

Hash Left Join (cost=61,920.99..98,021.52 rows=73,327 width=836) (actual time=1,216.296..1,760.203 rows=58,661 loops=3)

  • Hash Cond: (twl.wait_list_created_by = utwlr.user_id)
32. 29.616 1,735.181 ↑ 1.3 58,661 3 / 3

Hash Left Join (cost=59,200.93..94,293.21 rows=73,327 width=810) (actual time=1,215.141..1,735.181 rows=58,661 loops=3)

  • Hash Cond: (t.treatment_model_id = tm.treatment_model_id)
33. 151.589 1,705.508 ↑ 1.3 58,661 3 / 3

Hash Left Join (cost=59,198.44..93,282.48 rows=73,327 width=668) (actual time=1,215.064..1,705.508 rows=58,661 loops=3)

  • Hash Cond: (pp.procedure_auth_id = pa.procedure_auth_id)
34. 21.846 1,209.930 ↑ 1.3 58,661 3 / 3

Hash Left Join (cost=38,627.58..58,519.89 rows=73,327 width=642) (actual time=870.288..1,209.930 rows=58,661 loops=3)

  • Hash Cond: (t.treatment_id = twl.treatment_id)
35. 24.690 1,188.066 ↑ 1.3 58,661 3 / 3

Hash Left Join (cost=38,581.15..57,547.71 rows=73,327 width=638) (actual time=870.259..1,188.066 rows=58,661 loops=3)

  • Hash Cond: (pp.procedure_status_id = ps.procedure_status_id)
36. 20.350 1,163.358 ↑ 1.3 58,661 3 / 3

Hash Left Join (cost=38,579.99..56,713.76 rows=73,327 width=550) (actual time=870.230..1,163.358 rows=58,661 loops=3)

  • Hash Cond: (pp.procedure_performed_amb_id = ppamb.procedure_performed_amb_id)
37. 33.660 1,142.999 ↑ 1.3 58,661 3 / 3

Hash Left Join (cost=38,555.37..55,763.39 rows=73,327 width=470) (actual time=870.214..1,142.999 rows=58,661 loops=3)

  • Hash Cond: ((pp.procedure_code)::text = (proc.procedure_code)::text)
38. 109.015 1,109.208 ↑ 1.3 58,661 3 / 3

Hash Left Join (cost=38,549.51..54,749.28 rows=73,327 width=292) (actual time=870.031..1,109.208 rows=58,661 loops=3)

  • Hash Cond: (pp.procedure_performed_id = ppp.procedure_performed_id)
39. 97.224 249.088 ↑ 1.3 58,661 3 / 3

Hash Join (cost=7,863.72..17,787.74 rows=73,327 width=159) (actual time=118.771..249.088 rows=58,661 loops=3)

  • Hash Cond: (pp.treatment_id = t.treatment_id)
40. 33.462 33.462 ↑ 1.3 58,661 3 / 3

Parallel Seq Scan on procedure_performed pp (cost=0.00..5,127.27 rows=73,327 width=72) (actual time=0.034..33.462 rows=58,661 loops=3)

41. 63.029 118.402 ↑ 1.0 157,321 3 / 3

Hash (cost=3,746.21..3,746.21 rows=157,321 width=87) (actual time=118.402..118.402 rows=157,321 loops=3)

  • Buckets: 32,768 Batches: 8 Memory Usage: 1,642kB
42. 55.373 55.373 ↑ 1.0 157,321 3 / 3

Seq Scan on treatment t (cost=0.00..3,746.21 rows=157,321 width=87) (actual time=0.022..55.373 rows=157,321 loops=3)

43. 52.386 751.105 ↑ 1.0 100,240 3 / 3

Hash (cost=27,376.63..27,376.63 rows=100,253 width=137) (actual time=751.105..751.105 rows=100,240 loops=3)

  • Buckets: 32,768 Batches: 8 Memory Usage: 1,504kB
44. 14.626 698.719 ↑ 1.0 100,240 3 / 3

Subquery Scan on ppp (cost=22,363.98..27,376.63 rows=100,253 width=137) (actual time=142.708..698.719 rows=100,240 loops=3)

45. 524.810 684.093 ↑ 1.0 100,240 3 / 3

GroupAggregate (cost=22,363.98..26,374.10 rows=100,253 width=137) (actual time=142.706..684.093 rows=100,240 loops=3)

  • Group Key: ppp_1.procedure_performed_id
46. 96.484 159.283 ↑ 1.0 100,253 3 / 3

Sort (cost=22,363.98..22,614.61 rows=100,253 width=133) (actual time=142.636..159.283 rows=100,253 loops=3)

  • Sort Key: ppp_1.procedure_performed_id
  • Sort Method: external merge Disk: 5,624kB
47. 21.122 62.799 ↑ 1.0 100,253 3 / 3

Hash Left Join (cost=2,721.22..7,179.82 rows=100,253 width=133) (actual time=1.379..62.799 rows=100,253 loops=3)

  • Hash Cond: (ppp_1.procedure_payment_type_id = ppt.procedure_payment_type_id)
48. 29.840 41.656 ↑ 1.0 100,253 3 / 3

Hash Left Join (cost=2,720.07..6,040.07 rows=100,253 width=45) (actual time=1.345..41.656 rows=100,253 loops=3)

  • Hash Cond: (ppp_1.created_by = u.user_id)
49. 10.507 10.507 ↑ 1.0 100,253 3 / 3

Seq Scan on procedure_performed_payment ppp_1 (cost=0.00..1,941.53 rows=100,253 width=23) (actual time=0.024..10.507 rows=100,253 loops=3)

50. 0.109 1.309 ↑ 1.0 422 3 / 3

Hash (cost=2,714.79..2,714.79 rows=422 width=30) (actual time=1.309..1.309 rows=422 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 32kB
51. 0.280 1.200 ↑ 1.0 422 3 / 3

Nested Loop Left Join (cost=0.42..2,714.79 rows=422 width=30) (actual time=0.022..1.200 rows=422 loops=3)

52. 0.076 0.076 ↑ 1.0 422 3 / 3

Seq Scan on "user" u (cost=0.00..15.22 rows=422 width=8) (actual time=0.012..0.076 rows=422 loops=3)

53. 0.844 0.844 ↑ 1.0 1 1,266 / 3

Index Scan using person_pkey on person p_1 (cost=0.42..6.40 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=1,266)

  • Index Cond: (person_id = u.person_id)
54. 0.006 0.021 ↑ 1.0 7 3 / 3

Hash (cost=1.07..1.07 rows=7 width=92) (actual time=0.021..0.021 rows=7 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
55. 0.015 0.015 ↑ 1.0 7 3 / 3

Seq Scan on procedure_payment_type ppt (cost=0.00..1.07 rows=7 width=92) (actual time=0.013..0.015 rows=7 loops=3)

56. 0.027 0.131 ↑ 1.0 84 3 / 3

Hash (cost=4.80..4.80 rows=84 width=187) (actual time=0.131..0.131 rows=84 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 18kB
57. 0.039 0.104 ↑ 1.0 84 3 / 3

Hash Left Join (cost=1.09..4.80 rows=84 width=187) (actual time=0.067..0.104 rows=84 loops=3)

  • Hash Cond: (proc.procedure_type_id = pt.procedure_type_id)
58. 0.047 0.047 ↑ 1.0 84 3 / 3

Seq Scan on procedure proc (cost=0.00..2.84 rows=84 width=69) (actual time=0.036..0.047 rows=84 loops=3)

59. 0.003 0.018 ↑ 1.0 4 3 / 3

Hash (cost=1.04..1.04 rows=4 width=122) (actual time=0.018..0.018 rows=4 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
60. 0.015 0.015 ↑ 1.0 4 3 / 3

Seq Scan on procedure_type pt (cost=0.00..1.04 rows=4 width=122) (actual time=0.014..0.015 rows=4 loops=3)

61. 0.001 0.009 ↓ 0.0 0 3 / 3

Hash (cost=16.50..16.50 rows=650 width=88) (actual time=0.009..0.009 rows=0 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
62. 0.008 0.008 ↓ 0.0 0 3 / 3

Seq Scan on procedure_performed_amb ppamb (cost=0.00..16.50 rows=650 width=88) (actual time=0.008..0.008 rows=0 loops=3)

63. 0.007 0.018 ↑ 1.0 7 3 / 3

Hash (cost=1.07..1.07 rows=7 width=92) (actual time=0.018..0.018 rows=7 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
64. 0.011 0.011 ↑ 1.0 7 3 / 3

Seq Scan on procedure_status ps (cost=0.00..1.07 rows=7 width=92) (actual time=0.009..0.011 rows=7 loops=3)

65. 0.000 0.018 ↓ 0.0 0 3 / 3

Hash (cost=43.93..43.93 rows=200 width=8) (actual time=0.018..0.018 rows=0 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
66. 0.001 0.018 ↓ 0.0 0 3 / 3

Subquery Scan on twl (cost=39.28..43.93 rows=200 width=8) (actual time=0.018..0.018 rows=0 loops=3)

67. 0.000 0.017 ↓ 0.0 0 3 / 3

Unique (cost=39.28..41.93 rows=200 width=12) (actual time=0.017..0.017 rows=0 loops=3)

68. 0.008 0.017 ↓ 0.0 0 3 / 3

Sort (cost=39.28..40.61 rows=530 width=12) (actual time=0.017..0.017 rows=0 loops=3)

  • Sort Key: treatment_wait_list.treatment_id, treatment_wait_list.wait_list_patient_arrival
  • Sort Method: quicksort Memory: 25kB
69. 0.009 0.009 ↓ 0.0 0 3 / 3

Seq Scan on treatment_wait_list (cost=0.00..15.30 rows=530 width=12) (actual time=0.009..0.009 rows=0 loops=3)

70. 56.309 343.989 ↑ 1.0 168,621 3 / 3

Hash (cost=17,310.10..17,310.10 rows=168,621 width=30) (actual time=343.989..343.989 rows=168,621 loops=3)

  • Buckets: 65,536 Batches: 4 Memory Usage: 2,966kB
71. 114.058 287.680 ↑ 1.0 168,621 3 / 3

Hash Right Join (cost=6,232.97..17,310.10 rows=168,621 width=30) (actual time=87.886..287.680 rows=168,621 loops=3)

  • Hash Cond: (s.procedure_auth_id = pa.procedure_auth_id)
72. 86.177 86.177 ↑ 1.0 138,481 3 / 3

Seq Scan on sadt s (cost=0.00..6,985.81 rows=138,481 width=12) (actual time=0.076..86.177 rows=138,481 loops=3)

73. 49.211 87.445 ↑ 1.0 168,621 3 / 3

Hash (cost=3,136.21..3,136.21 rows=168,621 width=22) (actual time=87.445..87.445 rows=168,621 loops=3)

  • Buckets: 65,536 Batches: 4 Memory Usage: 2,488kB
74. 38.234 38.234 ↑ 1.0 168,621 3 / 3

Seq Scan on procedure_auth pa (cost=0.00..3,136.21 rows=168,621 width=22) (actual time=0.020..38.234 rows=168,621 loops=3)

75. 0.005 0.057 ↑ 1.0 9 3 / 3

Hash (cost=2.37..2.37 rows=9 width=146) (actual time=0.057..0.057 rows=9 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
76. 0.016 0.052 ↑ 1.0 9 3 / 3

Hash Left Join (cost=1.18..2.37 rows=9 width=146) (actual time=0.047..0.052 rows=9 loops=3)

  • Hash Cond: (tm.treatment_seq_id = tseq.treatment_seq_id)
77. 0.015 0.015 ↑ 1.0 9 3 / 3

Seq Scan on treatment_model tm (cost=0.00..1.09 rows=9 width=126) (actual time=0.013..0.015 rows=9 loops=3)

78. 0.008 0.021 ↑ 1.0 8 3 / 3

Hash (cost=1.08..1.08 rows=8 width=28) (actual time=0.021..0.021 rows=8 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
79. 0.013 0.013 ↑ 1.0 8 3 / 3

Seq Scan on treatment_seq tseq (cost=0.00..1.08 rows=8 width=28) (actual time=0.011..0.013 rows=8 loops=3)

80. 0.107 1.141 ↑ 1.0 422 3 / 3

Hash (cost=2,714.79..2,714.79 rows=422 width=30) (actual time=1.141..1.141 rows=422 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 32kB
81. 0.134 1.034 ↑ 1.0 422 3 / 3

Nested Loop Left Join (cost=0.42..2,714.79 rows=422 width=30) (actual time=0.017..1.034 rows=422 loops=3)

82. 0.056 0.056 ↑ 1.0 422 3 / 3

Seq Scan on "user" utwlr (cost=0.00..15.22 rows=422 width=8) (actual time=0.006..0.056 rows=422 loops=3)

83. 0.844 0.844 ↑ 1.0 1 1,266 / 3

Index Scan using person_pkey on person petwlr (cost=0.42..6.40 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=1,266)

  • Index Cond: (person_id = utwlr.person_id)
84. 0.005 0.021 ↑ 1.0 4 3 / 3

Hash (cost=1.04..1.04 rows=4 width=122) (actual time=0.021..0.021 rows=4 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
85. 0.016 0.016 ↑ 1.0 4 3 / 3

Seq Scan on treatment_status ts (cost=0.00..1.04 rows=4 width=122) (actual time=0.015..0.016 rows=4 loops=3)

86. 0.004 461.786 ↑ 787.0 1 1

Hash (cost=3,539.72..3,539.72 rows=787 width=134) (actual time=461.786..461.786 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
87. 461.782 461.782 ↑ 787.0 1 1

CTE Scan on tt (cost=0.00..3,539.72 rows=787 width=134) (actual time=105.071..461.782 rows=1 loops=1)

  • Filter: (patient_id = 19,754)
  • Rows Removed by Filter: 157,320
88. 0.007 0.007 ↓ 0.0 0 1

Index Scan using sadt_lot_map_mv_sadt_lot_id on sadt_lot_map_mv lot_map_aux (cost=0.28..0.30 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (sadt_lot_id = s.sadt_lot_id)
89. 1.186 2.487 ↑ 1.0 8,029 1

Hash (cost=166.29..166.29 rows=8,029 width=12) (actual time=2.487..2.487 rows=8,029 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 378kB
90. 1.301 1.301 ↑ 1.0 8,029 1

Seq Scan on sadt_lot_map_mv lot_map (cost=0.00..166.29 rows=8,029 width=12) (actual time=0.016..1.301 rows=8,029 loops=1)

91. 1.127 2.550 ↑ 1.0 8,029 1

Hash (cost=184.30..184.30 rows=8,030 width=12) (actual time=2.550..2.550 rows=8,029 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 409kB
92. 1.423 1.423 ↑ 1.0 8,029 1

Seq Scan on sadt_lot sl (cost=0.00..184.30 rows=8,030 width=12) (actual time=0.011..1.423 rows=8,029 loops=1)

93. 0.011 0.030 ↑ 1.0 77 1

Hash (cost=2.77..2.77 rows=77 width=4) (actual time=0.030..0.030 rows=77 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
94. 0.019 0.019 ↑ 1.0 77 1

Seq Scan on recourse rec (cost=0.00..2.77 rows=77 width=4) (actual time=0.009..0.019 rows=77 loops=1)

95. 2.144 3.848 ↑ 1.0 7,749 1

Hash (cost=231.49..231.49 rows=7,749 width=111) (actual time=3.848..3.848 rows=7,749 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 1,175kB
96. 1.704 1.704 ↑ 1.0 7,749 1

Seq Scan on recourse_has_procedure_performed rhpp (cost=0.00..231.49 rows=7,749 width=111) (actual time=0.007..1.704 rows=7,749 loops=1)

97. 0.098 0.204 ↑ 1.0 607 1

Hash (cost=13.07..13.07 rows=607 width=60) (actual time=0.204..0.204 rows=607 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 63kB
98. 0.106 0.106 ↑ 1.0 607 1

Seq Scan on import_tuss_38 it38 (cost=0.00..13.07 rows=607 width=60) (actual time=0.008..0.106 rows=607 loops=1)

99. 0.090 1.190 ↑ 1.0 422 1

Hash (cost=2,714.79..2,714.79 rows=422 width=30) (actual time=1.190..1.190 rows=422 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 32kB
100. 0.202 1.100 ↑ 1.0 422 1

Nested Loop Left Join (cost=0.42..2,714.79 rows=422 width=30) (actual time=0.013..1.100 rows=422 loops=1)

101. 0.054 0.054 ↑ 1.0 422 1

Seq Scan on "user" ttu (cost=0.00..15.22 rows=422 width=8) (actual time=0.007..0.054 rows=422 loops=1)

102. 0.844 0.844 ↑ 1.0 1 422

Index Scan using person_pkey on person ttpe (cost=0.42..6.40 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=422)

  • Index Cond: (person_id = ttu.person_id)
103. 0.001 0.015 ↑ 1.0 1 1

Hash (cost=16.87..16.87 rows=1 width=30) (actual time=0.015..0.015 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
104. 0.002 0.014 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.83..16.87 rows=1 width=30) (actual time=0.012..0.014 rows=1 loops=1)

105. 0.008 0.008 ↑ 1.0 1 1

Index Scan using patient_pkey on patient p (cost=0.42..8.44 rows=1 width=8) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (patient_id = 19,754)
106. 0.004 0.004 ↑ 1.0 1 1

Index Scan using person_pkey on person ppe (cost=0.42..8.44 rows=1 width=30) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (person_id = p.person_id)
107. 0.011 0.027 ↑ 1.0 60 1

Hash (cost=1.60..1.60 rows=60 width=23) (actual time=0.027..0.027 rows=60 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
108. 0.016 0.016 ↑ 1.0 60 1

Seq Scan on health_insurance_company hic (cost=0.00..1.60 rows=60 width=23) (actual time=0.009..0.016 rows=60 loops=1)

109. 0.026 0.050 ↑ 1.0 143 1

Hash (cost=3.43..3.43 rows=143 width=27) (actual time=0.050..0.050 rows=143 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
110. 0.024 0.024 ↑ 1.0 143 1

Seq Scan on health_insurance_company_plan hicp (cost=0.00..3.43 rows=143 width=27) (actual time=0.007..0.024 rows=143 loops=1)

111. 0.011 0.019 ↑ 1.0 1 1

Hash (cost=8.44..8.44 rows=1 width=24) (actual time=0.019..0.019 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
112. 0.008 0.008 ↑ 1.0 1 1

Index Scan using patient_has_health_insurance_company_plan_pkey on patient_has_health_insurance_company_plan phhicp (cost=0.42..8.44 rows=1 width=24) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (patient_id = 19,754)
113. 49.784 253.061 ↑ 6.6 22,105 1

GroupAggregate (cost=29,414.05..37,098.81 rows=146,124 width=109) (actual time=199.741..253.061 rows=22,105 loops=1)

  • Group Key: thhp.treatment_id
114. 116.276 203.277 ↑ 6.6 26,376 1

Sort (cost=29,414.05..29,846.98 rows=173,174 width=42) (actual time=199.714..203.277 rows=26,376 loops=1)

  • Sort Key: thhp.treatment_id
  • Sort Method: external sort Disk: 8,152kB
115. 46.152 87.001 ↑ 1.0 173,174 1

Hash Left Join (cost=3,458.92..9,015.80 rows=173,174 width=42) (actual time=25.111..87.001 rows=173,174 loops=1)

  • Hash Cond: (thhp.health_professional_id = php.health_professional_id)
116. 15.763 15.763 ↑ 1.0 173,174 1

Seq Scan on treatment_has_health_professional thhp (cost=0.00..3,175.74 rows=173,174 width=16) (actual time=0.013..15.763 rows=173,174 loops=1)

117. 0.510 25.086 ↓ 1.0 2,387 1

Hash (cost=3,429.09..3,429.09 rows=2,386 width=30) (actual time=25.086..25.086 rows=2,387 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 174kB
118. 12.757 24.576 ↓ 1.0 2,387 1

Hash Right Join (cost=69.69..3,429.09 rows=2,386 width=30) (actual time=0.629..24.576 rows=2,387 loops=1)

  • Hash Cond: (phppe.person_id = php.person_id)
119. 11.208 11.208 ↓ 1.0 110,386 1

Seq Scan on person phppe (cost=0.00..2,921.67 rows=110,367 width=30) (actual time=0.008..11.208 rows=110,386 loops=1)

120. 0.295 0.611 ↓ 1.0 2,387 1

Hash (cost=39.86..39.86 rows=2,386 width=8) (actual time=0.611..0.611 rows=2,387 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 126kB
121. 0.316 0.316 ↓ 1.0 2,387 1

Seq Scan on health_professional php (cost=0.00..39.86 rows=2,386 width=8) (actual time=0.009..0.316 rows=2,387 loops=1)

122. 0.075 1.074 ↑ 1.0 422 1

Hash (cost=2,714.79..2,714.79 rows=422 width=30) (actual time=1.074..1.074 rows=422 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 32kB
123. 0.097 0.999 ↑ 1.0 422 1

Nested Loop Left Join (cost=0.42..2,714.79 rows=422 width=30) (actual time=0.020..0.999 rows=422 loops=1)

124. 0.058 0.058 ↑ 1.0 422 1

Seq Scan on "user" rep_u (cost=0.00..15.22 rows=422 width=8) (actual time=0.012..0.058 rows=422 loops=1)

125. 0.844 0.844 ↑ 1.0 1 422

Index Scan using person_pkey on person rep_p (cost=0.42..6.40 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=422)

  • Index Cond: (person_id = rep_u.person_id)
126. 0.039 0.077 ↑ 1.0 189 1

Hash (cost=6.89..6.89 rows=189 width=36) (actual time=0.077..0.077 rows=189 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 21kB
127. 0.038 0.038 ↑ 1.0 189 1

Seq Scan on health_facility rhf (cost=0.00..6.89 rows=189 width=36) (actual time=0.009..0.038 rows=189 loops=1)

128. 0.316 0.644 ↓ 1.0 2,387 1

Hash (cost=39.86..39.86 rows=2,386 width=8) (actual time=0.644..0.644 rows=2,387 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 126kB
129. 0.328 0.328 ↓ 1.0 2,387 1

Seq Scan on health_professional rhp (cost=0.00..39.86 rows=2,386 width=8) (actual time=0.008..0.328 rows=2,387 loops=1)

130. 0.005 0.005 ↑ 1.0 1 1

Index Scan using person_pkey on person rhppe (cost=0.42..3.36 rows=1 width=30) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (person_id = rhp.person_id)
131. 0.902 1.730 ↓ 1.0 5,509 1

Hash (cost=96.08..96.08 rows=5,508 width=13) (actual time=1.730..1.730 rows=5,509 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 322kB
132. 0.828 0.828 ↓ 1.0 5,509 1

Seq Scan on profession rhpprof (cost=0.00..96.08 rows=5,508 width=13) (actual time=0.009..0.828 rows=5,509 loops=1)

Planning time : 18.838 ms
Execution time : 2,826.019 ms