explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TvYu

Settings
# exclusive inclusive rows x rows loops node
1. 267.030 2,207.421 ↑ 1,602.0 1 1

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

  • Workers Planned: 2
  • Workers Launched: 2
2. 0.156 1,940.391 ↓ 0.0 0 3 / 3

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Merge Left Join (cost=116,045.49..116,058.93 rows=668 width=1,360) (actual time=1,865.406..1,865.407 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.001 1,865.113 ↓ 0.0 0 3 / 3

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

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

Merge Left Join (cost=116,033.67..116,039.78 rows=668 width=1,329) (actual time=1,865.101..1,865.102 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.011 1,865.064 ↓ 0.0 0 3 / 3

Sort (cost=116,025.13..116,026.80 rows=668 width=1,310) (actual time=1,865.064..1,865.064 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.005 1,865.053 ↓ 0.0 0 3 / 3

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

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

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

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

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

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

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

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

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

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

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

19. 0.002 1,863.113 ↓ 0.0 0 3 / 3

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

20. 0.002 1,863.111 ↓ 0.0 0 3 / 3

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

21. 8.350 1,863.106 ↓ 0.0 0 3 / 3

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

33. 73.698 133.185 ↑ 1.0 157,321 3 / 3

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

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

35. 59.534 777.075 ↑ 1.0 100,240 3 / 3

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

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

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

37. 533.955 702.517 ↑ 1.0 100,240 3 / 3

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

  • Group Key: ppp_1.procedure_performed_id
38. 103.879 168.562 ↑ 1.0 100,253 3 / 3

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

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

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

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

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

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

42. 0.127 1.522 ↑ 1.0 422 3 / 3

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

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

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

44. 0.085 0.085 ↑ 1.0 422 3 / 3

Seq Scan on "user" u (cost=0.00..15.22 rows=422 width=8) (actual time=0.017..0.085 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.013 0.031 ↑ 1.0 7 3 / 3

Hash (cost=1.07..1.07 rows=7 width=92) (actual time=0.031..0.031 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.035 0.139 ↑ 1.0 84 3 / 3

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

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

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

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

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

51. 0.003 0.016 ↑ 1.0 4 3 / 3

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

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

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

53. 0.000 0.010 ↓ 0.0 0 3 / 3

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

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

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

55. 0.013 0.026 ↑ 1.0 7 3 / 3

Hash (cost=1.07..1.07 rows=7 width=92) (actual time=0.026..0.026 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.011..0.013 rows=7 loops=3)

57. 0.000 0.015 ↓ 0.0 0 3 / 3

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

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

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

59. 0.000 0.014 ↓ 0.0 0 3 / 3

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

60. 0.007 0.014 ↓ 0.0 0 3 / 3

Sort (cost=39.28..40.61 rows=530 width=12) (actual time=0.014..0.014 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.007 0.007 ↓ 0.0 0 3 / 3

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

62. 59.773 354.043 ↑ 1.0 168,621 3 / 3

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

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

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

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

65. 53.646 92.307 ↑ 1.0 168,621 3 / 3

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

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

67. 0.007 0.067 ↑ 1.0 9 3 / 3

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

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

Hash Left Join (cost=1.18..2.37 rows=9 width=146) (actual time=0.055..0.060 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.019..0.021 rows=9 loops=3)

70. 0.011 0.024 ↑ 1.0 8 3 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
71. 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.010..0.013 rows=8 loops=3)

72. 0.104 1.187 ↑ 1.0 422 3 / 3

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

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

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

74. 0.059 0.059 ↑ 1.0 422 3 / 3

Seq Scan on "user" utwlr (cost=0.00..15.22 rows=422 width=8) (actual time=0.006..0.059 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.009 0.026 ↑ 1.0 4 3 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
77. 0.017 0.017 ↑ 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.017 rows=4 loops=3)

78. 0.008 0.424 ↑ 1,432.0 1 3 / 3

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

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

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

80. 0.003 0.396 ↑ 2.0 1 3 / 3

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

81. 0.014 0.393 ↑ 2.0 1 3 / 3

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

82. 0.208 0.208 ↑ 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.208..0.208 rows=1 loops=3)

  • Index Cond: (patient_id = 5,487)
83. 0.171 0.171 ↑ 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.170..0.171 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.001 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.018 0.018 ↓ 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.018..0.018 rows=0 loops=3)

  • Index Cond: (patient_id = 5,487)
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.003 0.003 ↓ 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.008..0.008 rows=0 loops=1)

  • Index Cond: (sadt_lot_id = s.sadt_lot_id)
89. 0.000 0.000 ↓ 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.001..0.001 rows=0 loops=1)

  • Index Cond: (sadt_lot_id = lot_map_aux.root_id)
90. 0.000 0.000 ↓ 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.001..0.001 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.035..0.035 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.013..0.024 rows=77 loops=1)

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

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

  • Buckets: 8,192 Batches: 1 Memory Usage: 1,175kB
94. 0.568 0.568 ↑ 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.009..1.705 rows=7,749 loops=1)

95. 0.034 0.068 ↑ 1.0 607 1 / 3

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
96. 0.034 0.034 ↑ 1.0 607 1 / 3

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

97. 0.029 0.374 ↑ 1.0 422 1 / 3

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

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

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

99. 0.019 0.019 ↑ 1.0 422 1 / 3

Seq Scan on "user" ttu (cost=0.00..15.22 rows=422 width=8) (actual time=0.007..0.056 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.001 0.165 ↑ 1.0 1 1 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
102. 0.001 0.165 ↑ 1.0 1 1 / 3

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

103. 0.161 0.161 ↑ 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.483..0.484 rows=1 loops=1)

  • Index Cond: (patient_id = 5,487)
104. 0.002 0.002 ↑ 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.006..0.006 rows=1 loops=1)

  • Index Cond: (person_id = p.person_id)
105. 0.024 0.033 ↑ 5.5 26 1 / 3

Sort (cost=8.55..8.91 rows=143 width=27) (actual time=0.099..0.100 rows=26 loops=1)

  • Sort Key: hicp.health_insurance_company_id, hicp.health_insurance_company_plan_id
  • Sort Method: quicksort Memory: 35kB
106. 0.009 0.009 ↑ 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.011..0.028 rows=143 loops=1)

107. 0.006 0.010 ↑ 8.6 7 1 / 3

Sort (cost=3.37..3.52 rows=60 width=23) (actual time=0.029..0.030 rows=7 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.002 0.291 ↑ 1.0 1 1 / 3

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

  • Sort Key: phhicp.health_insurance_company_id, phhicp.health_insurance_company_plan_id
  • Sort Method: quicksort Memory: 25kB
110. 0.289 0.289 ↑ 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.867..0.868 rows=1 loops=1)

  • Index Cond: (patient_id = 5,487)
111. 0.026 0.339 ↑ 1.0 422 1 / 3

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

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

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

113. 0.017 0.017 ↑ 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.051 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.009..0.037 rows=189 loops=1)

117. 0.098 0.194 ↓ 1.0 2,387 1 / 3

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 126kB
118. 0.097 0.097 ↓ 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.290 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.276 0.542 ↓ 1.0 5,509 1 / 3

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

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

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

122. 4.320 73.663 ↑ 25.3 5,787 1 / 3

GroupAggregate (cost=29,414.05..37,098.81 rows=146,124 width=109) (actual time=207.217..220.990 rows=5,787 loops=1)

  • Group Key: thhp.treatment_id
123. 39.896 69.343 ↑ 28.0 6,184 1 / 3

Sort (cost=29,414.05..29,846.98 rows=173,174 width=42) (actual time=207.190..208.030 rows=6,184 loops=1)

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

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

  • Hash Cond: (thhp.health_professional_id = php.health_professional_id)
125. 5.450 5.450 ↑ 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.009..16.349 rows=173,174 loops=1)

126. 0.149 7.712 ↓ 1.0 2,387 1 / 3

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

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

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

  • Hash Cond: (phppe.person_id = php.person_id)
128. 3.460 3.460 ↓ 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.380 rows=110,386 loops=1)

129. 0.104 0.199 ↓ 1.0 2,387 1 / 3

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 126kB
130. 0.095 0.095 ↓ 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.007..0.284 rows=2,387 loops=1)

Planning time : 19.523 ms
Execution time : 2,213.971 ms