explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Qzvy

Settings
# exclusive inclusive rows x rows loops node
1. 325.432 2,263.837 ↑ 1,602.0 1 1

Gather (cost=151,743.03..161,664.38 rows=1,602 width=1,856) (actual time=2,263.833..2,263.837 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 0.239 1,938.405 ↓ 0.0 0 3 / 3

Merge Left Join (cost=150,743.03..160,364.08 rows=668 width=1,856) (actual time=1,938.404..1,938.405 rows=0 loops=3)

  • Merge Cond: (t.treatment_id = thhp.treatment_id)
3. 0.029 1,863.947 ↓ 0.0 0 3 / 3

Sort (cost=121,328.98..121,330.65 rows=668 width=1,445) (actual time=1,863.947..1,863.947 rows=0 loops=3)

  • Sort Key: t.treatment_id
  • Sort Method: quicksort Memory: 25kB
4. 0.005 1,863.918 ↓ 0.0 0 3 / 3

Hash Left Join (cost=119,009.84..121,297.63 rows=668 width=1,445) (actual time=1,863.917..1,863.918 rows=0 loops=3)

  • Hash Cond: ("*SELECT* 1".profession_id = rhpprof.profession_id)
5. 0.002 1,863.377 ↓ 0.0 0 3 / 3

Nested Loop Left Join (cost=118,844.91..121,124.27 rows=668 width=1,440) (actual time=1,863.376..1,863.377 rows=0 loops=3)

6. 0.003 1,863.374 ↓ 0.0 0 3 / 3

Hash Left Join (cost=118,844.49..118,877.28 rows=668 width=1,418) (actual time=1,863.374..1,863.374 rows=0 loops=3)

  • Hash Cond: ("*SELECT* 1".health_professional_id = rhp.health_professional_id)
7. 0.004 1,863.169 ↓ 0.0 0 3 / 3

Hash Left Join (cost=118,774.81..118,799.17 rows=668 width=1,414) (actual time=1,863.168..1,863.169 rows=0 loops=3)

  • Hash Cond: ("*SELECT* 1".health_facility_id = rhf.health_facility_id)
8. 0.004 1,863.143 ↓ 0.0 0 3 / 3

Hash Left Join (cost=118,765.56..118,781.51 rows=668 width=1,382) (actual time=1,863.143..1,863.143 rows=0 loops=3)

  • Hash Cond: (pp.repassed_by = rep_u.user_id)
9. 0.002 1,862.789 ↓ 0.0 0 3 / 3

Merge Left Join (cost=116,045.49..116,058.93 rows=668 width=1,360) (actual time=1,862.789..1,862.789 rows=0 loops=3)

  • Merge Cond: (("*SELECT* 1".health_insurance_company_id = phhicp.health_insurance_company_id) AND ("*SELECT* 1".health_insurance_company_plan_id = phhicp.health_insurance_company_plan_id))
  • Join Filter: (phhicp.patient_id = "*SELECT* 1".patient_id)
10. 0.002 1,862.781 ↓ 0.0 0 3 / 3

Merge Left Join (cost=116,037.05..116,047.12 rows=668 width=1,348) (actual time=1,862.781..1,862.781 rows=0 loops=3)

  • Merge Cond: ("*SELECT* 1".health_insurance_company_id = hic.health_insurance_company_id)
11. 0.004 1,862.769 ↓ 0.0 0 3 / 3

Merge Left Join (cost=116,033.67..116,039.78 rows=668 width=1,329) (actual time=1,862.769..1,862.769 rows=0 loops=3)

  • Merge Cond: (("*SELECT* 1".health_insurance_company_id = hicp.health_insurance_company_id) AND ("*SELECT* 1".health_insurance_company_plan_id = hicp.health_insurance_company_plan_id))
12. 0.018 1,862.727 ↓ 0.0 0 3 / 3

Sort (cost=116,025.13..116,026.80 rows=668 width=1,310) (actual time=1,862.726..1,862.727 rows=0 loops=3)

  • Sort Key: "*SELECT* 1".health_insurance_company_id, "*SELECT* 1".health_insurance_company_plan_id
  • Sort Method: quicksort Memory: 25kB
13. 0.003 1,862.709 ↓ 0.0 0 3 / 3

Hash Left Join (cost=65,107.74..115,993.78 rows=668 width=1,310) (actual time=1,829.641..1,862.709 rows=0 loops=3)

  • Hash Cond: ("*SELECT* 1".patient_id = p.patient_id)
14. 0.003 1,862.701 ↓ 0.0 0 3 / 3

Hash Left Join (cost=65,090.85..115,967.72 rows=668 width=1,284) (actual time=1,829.633..1,862.701 rows=0 loops=3)

  • Hash Cond: ("*SELECT* 1".created_by = ttu.user_id)
15. 0.003 1,862.331 ↓ 0.0 0 3 / 3

Hash Left Join (cost=62,370.79..113,238.47 rows=668 width=1,258) (actual time=1,829.264..1,862.331 rows=0 loops=3)

  • Hash Cond: ((rhpp.gloss_over_code)::text = (it38.code)::text)
16. 0.005 1,862.265 ↓ 0.0 0 3 / 3

Hash Left Join (cost=62,350.13..113,209.38 rows=668 width=1,203) (actual time=1,829.198..1,862.265 rows=0 loops=3)

  • Hash Cond: ((rec.recourse_id = rhpp.recourse_id) AND (pp.procedure_performed_id = rhpp.procedure_performed_id))
17. 0.005 1,860.964 ↓ 0.0 0 3 / 3

Hash Left Join (cost=62,002.41..112,853.30 rows=668 width=1,100) (actual time=1,827.897..1,860.964 rows=0 loops=3)

  • Hash Cond: (lot_map.recourse_id = rec.recourse_id)
18. 0.001 1,860.947 ↓ 0.0 0 3 / 3

Nested Loop Left Join (cost=61,998.67..112,841.13 rows=668 width=1,100) (actual time=1,827.880..1,860.947 rows=0 loops=3)

19. 0.001 1,860.945 ↓ 0.0 0 3 / 3

Nested Loop Left Join (cost=61,998.39..112,598.14 rows=668 width=1,088) (actual time=1,827.878..1,860.945 rows=0 loops=3)

20. 0.003 1,860.943 ↓ 0.0 0 3 / 3

Nested Loop Left Join (cost=61,998.11..112,361.13 rows=668 width=1,080) (actual time=1,827.876..1,860.943 rows=0 loops=3)

21. 8.116 1,860.938 ↓ 0.0 0 3 / 3

Hash Join (cost=61,997.83..112,158.61 rows=668 width=1,080) (actual time=1,827.871..1,860.938 rows=0 loops=3)

  • Hash Cond: (t.treatment_id = "*SELECT* 1".treatment_id)
22. 26.369 1,852.728 ↑ 1.3 58,661 3 / 3

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

  • Hash Cond: (t.treatment_status_id = ts.treatment_status_id)
23. 22.361 1,826.332 ↑ 1.3 58,661 3 / 3

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

  • Hash Cond: (twl.wait_list_created_by = utwlr.user_id)
24. 28.276 1,802.695 ↑ 1.3 58,661 3 / 3

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

  • Hash Cond: (t.treatment_model_id = tm.treatment_model_id)
25. 148.214 1,774.346 ↑ 1.3 58,661 3 / 3

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

  • Hash Cond: (pp.procedure_auth_id = pa.procedure_auth_id)
26. 21.281 1,272.964 ↑ 1.3 58,661 3 / 3

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

  • Hash Cond: (t.treatment_id = twl.treatment_id)
27. 24.716 1,251.657 ↑ 1.3 58,661 3 / 3

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

  • Hash Cond: (pp.procedure_status_id = ps.procedure_status_id)
28. 19.791 1,226.921 ↑ 1.3 58,661 3 / 3

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

  • Hash Cond: (pp.procedure_performed_amb_id = ppamb.procedure_performed_amb_id)
29. 32.367 1,207.118 ↑ 1.3 58,661 3 / 3

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

  • Hash Cond: ((pp.procedure_code)::text = (proc.procedure_code)::text)
30. 107.580 1,174.579 ↑ 1.3 58,661 3 / 3

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

  • Hash Cond: (pp.procedure_performed_id = ppp.procedure_performed_id)
31. 102.840 268.593 ↑ 1.3 58,661 3 / 3

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

  • Hash Cond: (pp.treatment_id = t.treatment_id)
32. 34.934 34.934 ↑ 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.031..34.934 rows=58,661 loops=3)

33. 74.031 130.819 ↑ 1.0 157,321 3 / 3

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

  • Buckets: 32,768 Batches: 8 Memory Usage: 1,642kB
34. 56.788 56.788 ↑ 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.023..56.788 rows=157,321 loops=3)

35. 63.427 798.406 ↑ 1.0 100,240 3 / 3

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

  • Buckets: 32,768 Batches: 8 Memory Usage: 1,504kB
36. 14.860 734.979 ↑ 1.0 100,240 3 / 3

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

37. 539.421 720.119 ↑ 1.0 100,240 3 / 3

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

  • Group Key: ppp_1.procedure_performed_id
38. 112.415 180.698 ↑ 1.0 100,253 3 / 3

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

  • Sort Key: ppp_1.procedure_performed_id
  • Sort Method: external merge Disk: 5,624kB
39. 22.802 68.283 ↑ 1.0 100,253 3 / 3

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

  • Hash Cond: (ppp_1.procedure_payment_type_id = ppt.procedure_payment_type_id)
40. 32.659 45.451 ↑ 1.0 100,253 3 / 3

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

  • Hash Cond: (ppp_1.created_by = u.user_id)
41. 11.319 11.319 ↑ 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.020..11.319 rows=100,253 loops=3)

42. 0.127 1.473 ↑ 1.0 422 3 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 32kB
43. 0.000 1.346 ↑ 1.0 422 3 / 3

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

44. 0.082 0.082 ↑ 1.0 422 3 / 3

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

45. 1.266 1.266 ↑ 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.003..0.003 rows=1 loops=1,266)

  • Index Cond: (person_id = u.person_id)
46. 0.012 0.030 ↑ 1.0 7 3 / 3

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

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

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

48. 0.042 0.172 ↑ 1.0 84 3 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 18kB
49. 0.067 0.130 ↑ 1.0 84 3 / 3

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

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

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

51. 0.003 0.017 ↑ 1.0 4 3 / 3

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

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

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

53. 0.000 0.012 ↓ 0.0 0 3 / 3

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

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

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

55. 0.007 0.020 ↑ 1.0 7 3 / 3

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

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

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

57. 0.000 0.026 ↓ 0.0 0 3 / 3

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

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

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

59. 0.000 0.025 ↓ 0.0 0 3 / 3

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

60. 0.017 0.025 ↓ 0.0 0 3 / 3

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

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

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

62. 61.328 353.168 ↑ 1.0 168,621 3 / 3

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

  • Buckets: 65,536 Batches: 4 Memory Usage: 2,966kB
63. 121.657 291.840 ↑ 1.0 168,621 3 / 3

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

  • Hash Cond: (s.procedure_auth_id = pa.procedure_auth_id)
64. 75.138 75.138 ↑ 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.037..75.138 rows=138,481 loops=3)

65. 55.592 95.045 ↑ 1.0 168,621 3 / 3

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

  • Buckets: 65,536 Batches: 4 Memory Usage: 2,488kB
66. 39.453 39.453 ↑ 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.018..39.453 rows=168,621 loops=3)

67. 0.005 0.073 ↑ 1.0 9 3 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
68. 0.017 0.068 ↑ 1.0 9 3 / 3

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

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

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

70. 0.010 0.030 ↑ 1.0 8 3 / 3

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

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

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

72. 0.115 1.276 ↑ 1.0 422 3 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 32kB
73. 0.252 1.161 ↑ 1.0 422 3 / 3

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

74. 0.065 0.065 ↑ 1.0 422 3 / 3

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

75. 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)
76. 0.007 0.027 ↑ 1.0 4 3 / 3

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

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

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

78. 0.006 0.094 ↑ 1,432.0 1 3 / 3

Hash (cost=57.85..57.85 rows=1,432 width=134) (actual time=0.094..0.094 rows=1 loops=3)

  • Buckets: 2,048 Batches: 1 Memory Usage: 17kB
79. 0.001 0.088 ↑ 1,432.0 1 3 / 3

Append (cost=0.84..57.85 rows=1,432 width=134) (actual time=0.066..0.088 rows=1 loops=3)

80. 0.001 0.068 ↑ 2.0 1 3 / 3

Subquery Scan on *SELECT* 1 (cost=0.84..27.23 rows=2 width=83) (actual time=0.066..0.068 rows=1 loops=3)

81. 0.011 0.067 ↑ 2.0 1 3 / 3

Nested Loop Left Join (cost=0.84..27.21 rows=2 width=603) (actual time=0.065..0.067 rows=1 loops=3)

82. 0.032 0.032 ↑ 2.0 1 3 / 3

Index Scan using request_patient_id_idx on request r_aux (cost=0.42..10.32 rows=2 width=43) (actual time=0.032..0.032 rows=1 loops=3)

  • Index Cond: (patient_id = 7,845)
83. 0.024 0.024 ↑ 1.0 1 3 / 3

Index Scan using treatment_request_id_idx on treatment t_aux (cost=0.42..8.44 rows=1 width=12) (actual time=0.023..0.024 rows=1 loops=3)

  • Index Cond: (request_id = r_aux.request_id)
84. 0.000 0.019 ↓ 0.0 0 3 / 3

Subquery Scan on *SELECT* 2 (cost=0.27..30.61 rows=1,430 width=134) (actual time=0.019..0.019 rows=0 loops=3)

85. 0.000 0.019 ↓ 0.0 0 3 / 3

Nested Loop Left Join (cost=0.27..16.31 rows=1,430 width=654) (actual time=0.019..0.019 rows=0 loops=3)

86. 0.019 0.019 ↓ 0.0 0 3 / 3

Index Scan using schedule_patient_id_idx on schedule s_aux (cost=0.14..8.16 rows=1 width=98) (actual time=0.019..0.019 rows=0 loops=3)

  • Index Cond: (patient_id = 7,845)
87. 0.000 0.000 ↓ 0.0 0 / 3

Index Scan using treatment_schedule_id_idx on treatment t_aux_1 (cost=0.12..8.14 rows=1 width=8) (never executed)

  • Index Cond: (schedule_id = s_aux.schedule_id)
88. 0.002 0.002 ↓ 0.0 0 1 / 3

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. 0.001 0.001 ↓ 0.0 0 1 / 3

Index Scan using sadt_lot_map_mv_sadt_lot_id on sadt_lot_map_mv lot_map (cost=0.28..0.35 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (sadt_lot_id = lot_map_aux.root_id)
90. 0.001 0.001 ↓ 0.0 0 1 / 3

Index Scan using sadt_lot_pkey on sadt_lot sl (cost=0.28..0.36 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (sadt_lot_id = lot_map.sadt_lot_id)
91. 0.004 0.012 ↑ 1.0 77 1 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
92. 0.008 0.008 ↑ 1.0 77 1 / 3

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

93. 0.708 1.296 ↑ 1.0 7,749 1 / 3

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

  • Buckets: 8,192 Batches: 1 Memory Usage: 1,175kB
94. 0.588 0.588 ↑ 1.0 7,749 1 / 3

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

95. 0.034 0.063 ↑ 1.0 607 1 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 63kB
96. 0.029 0.029 ↑ 1.0 607 1 / 3

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

97. 0.025 0.367 ↑ 1.0 422 1 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 32kB
98. 0.041 0.342 ↑ 1.0 422 1 / 3

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

99. 0.020 0.020 ↑ 1.0 422 1 / 3

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

100. 0.281 0.281 ↑ 1.0 1 422 / 3

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)
101. 0.000 0.005 ↑ 1.0 1 1 / 3

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
102. 0.001 0.005 ↑ 1.0 1 1 / 3

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

103. 0.003 0.003 ↑ 1.0 1 1 / 3

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 = 7,845)
104. 0.001 0.001 ↑ 1.0 1 1 / 3

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

  • Index Cond: (person_id = p.person_id)
105. 0.026 0.038 ↑ 4.8 30 1 / 3

Sort (cost=8.55..8.91 rows=143 width=27) (actual time=0.113..0.114 rows=30 loops=1)

  • Sort Key: hicp.health_insurance_company_id, hicp.health_insurance_company_plan_id
  • Sort Method: quicksort Memory: 35kB
106. 0.012 0.012 ↑ 1.0 143 1 / 3

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

107. 0.006 0.010 ↑ 5.5 11 1 / 3

Sort (cost=3.37..3.52 rows=60 width=23) (actual time=0.030..0.031 rows=11 loops=1)

  • Sort Key: hic.health_insurance_company_id
  • Sort Method: quicksort Memory: 29kB
108. 0.004 0.004 ↑ 1.0 60 1 / 3

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

109. 0.001 0.006 ↑ 1.0 1 1 / 3

Sort (cost=8.45..8.45 rows=1 width=24) (actual time=0.019..0.019 rows=1 loops=1)

  • Sort Key: phhicp.health_insurance_company_id, phhicp.health_insurance_company_plan_id
  • Sort Method: quicksort Memory: 25kB
110. 0.005 0.005 ↑ 1.0 1 1 / 3

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.014..0.015 rows=1 loops=1)

  • Index Cond: (patient_id = 7,845)
111. 0.026 0.350 ↑ 1.0 422 1 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 32kB
112. 0.024 0.324 ↑ 1.0 422 1 / 3

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

113. 0.019 0.019 ↑ 1.0 422 1 / 3

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

114. 0.281 0.281 ↑ 1.0 1 422 / 3

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)
115. 0.010 0.022 ↑ 1.0 189 1 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 21kB
116. 0.012 0.012 ↑ 1.0 189 1 / 3

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

117. 0.103 0.202 ↓ 1.0 2,387 1 / 3

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 126kB
118. 0.099 0.099 ↓ 1.0 2,387 1 / 3

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

119. 0.001 0.001 ↑ 1.0 1 1 / 3

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

  • Index Cond: (person_id = rhp.person_id)
120. 0.278 0.536 ↓ 1.0 5,509 1 / 3

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

  • Buckets: 8,192 Batches: 1 Memory Usage: 322kB
121. 0.257 0.257 ↓ 1.0 5,509 1 / 3

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

122. 6.924 74.219 ↑ 17.4 8,387 1 / 3

GroupAggregate (cost=29,414.05..37,098.81 rows=146,124 width=109) (actual time=200.532..222.658 rows=8,387 loops=1)

  • Group Key: thhp.treatment_id
123. 38.785 67.295 ↑ 18.8 9,204 1 / 3

Sort (cost=29,414.05..29,846.98 rows=173,174 width=42) (actual time=200.476..201.886 rows=9,204 loops=1)

  • Sort Key: thhp.treatment_id
  • Sort Method: external sort Disk: 8,152kB
124. 15.379 28.510 ↑ 1.0 173,174 1 / 3

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

  • Hash Cond: (thhp.health_professional_id = php.health_professional_id)
125. 5.291 5.291 ↑ 1.0 173,174 1 / 3

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

126. 0.132 7.840 ↓ 1.0 2,387 1 / 3

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 174kB
127. 3.918 7.708 ↓ 1.0 2,387 1 / 3

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

  • Hash Cond: (phppe.person_id = php.person_id)
128. 3.604 3.604 ↓ 1.0 110,386 1 / 3

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

129. 0.096 0.187 ↓ 1.0 2,387 1 / 3

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 126kB
130. 0.091 0.091 ↓ 1.0 2,387 1 / 3

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

Planning time : 20.105 ms
Execution time : 2,270.526 ms