explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1CGS

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 90.338 ↑ 1.0 1 1

Limit (cost=10,759.43..10,759.43 rows=1 width=9,002) (actual time=90.337..90.338 rows=1 loops=1)

2. 2.429 90.336 ↑ 1,379.0 1 1

Sort (cost=10,759.43..10,762.88 rows=1,379 width=9,002) (actual time=90.336..90.336 rows=1 loops=1)

  • Sort Key: m0_.performed_at DESC, m0_.id DESC
  • Sort Method: top-N heapsort Memory: 26kB
3. 1.659 87.907 ↓ 1.1 1,540 1

Hash Left Join (cost=7,400.01..10,752.53 rows=1,379 width=9,002) (actual time=56.305..87.907 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m27_.id)
4. 1.528 86.246 ↓ 1.1 1,540 1

Hash Left Join (cost=7,339.16..10,688.06 rows=1,379 width=8,998) (actual time=56.278..86.246 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m26_.id)
5. 1.479 84.716 ↓ 1.1 1,540 1

Hash Left Join (cost=7,283.26..10,628.54 rows=1,379 width=8,990) (actual time=56.257..84.716 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m25_.id)
6. 1.444 83.235 ↓ 1.1 1,540 1

Hash Left Join (cost=7,246.26..10,587.92 rows=1,379 width=8,954) (actual time=56.235..83.235 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m24_.id)
7. 1.537 81.788 ↓ 1.1 1,540 1

Hash Left Join (cost=7,236.03..10,574.08 rows=1,379 width=3,786) (actual time=56.213..81.788 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m23_.id)
8. 1.720 79.789 ↓ 1.1 1,540 1

Hash Left Join (cost=7,213.17..10,547.60 rows=1,379 width=3,706) (actual time=55.723..79.789 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m22_.id)
9. 1.301 67.701 ↓ 1.1 1,540 1

Hash Left Join (cost=6,277.42..9,608.23 rows=1,379 width=3,700) (actual time=45.164..67.701 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m21_.id)
10. 1.872 66.398 ↓ 1.1 1,540 1

Hash Left Join (cost=6,226.70..9,553.88 rows=1,379 width=3,687) (actual time=45.150..66.398 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m20_.id)
11. 1.375 63.688 ↓ 1.1 1,540 1

Hash Left Join (cost=6,133.75..9,457.31 rows=1,379 width=3,663) (actual time=44.295..63.688 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m19_.id)
12. 1.275 61.442 ↓ 1.1 1,540 1

Hash Left Join (cost=6,011.02..9,330.97 rows=1,379 width=3,659) (actual time=43.394..61.442 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m15_.id)
13. 11.871 60.038 ↓ 1.1 1,540 1

Hash Right Join (cost=5,985.04..9,301.37 rows=1,379 width=2,782) (actual time=43.247..60.038 rows=1,540 loops=1)

  • Hash Cond: (m17_.id = m0_.id)
14. 5.615 5.615 ↑ 1.0 46,655 1

Seq Scan on ma_nurse_observation m17_ (cost=0.00..3,138.55 rows=46,655 width=199) (actual time=0.010..5.615 rows=46,655 loops=1)

15. 1.217 42.552 ↓ 1.1 1,540 1

Hash (cost=5,967.80..5,967.80 rows=1,379 width=2,587) (actual time=42.552..42.552 rows=1,540 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 303kB
16. 4.086 41.335 ↓ 1.1 1,540 1

Hash Right Join (cost=5,354.15..5,967.80 rows=1,379 width=2,587) (actual time=40.214..41.335 rows=1,540 loops=1)

  • Hash Cond: (m16_.id = m0_.id)
17. 2.511 2.511 ↑ 1.0 31,907 1

Seq Scan on ma_liquid_measurement m16_ (cost=0.00..492.07 rows=31,907 width=12) (actual time=0.010..2.511 rows=31,907 loops=1)

18. 1.083 34.738 ↓ 1.1 1,540 1

Hash (cost=5,336.91..5,336.91 rows=1,379 width=2,579) (actual time=34.738..34.738 rows=1,540 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 303kB
19. 3.067 33.655 ↓ 1.1 1,540 1

Hash Right Join (cost=4,898.40..5,336.91 rows=1,379 width=2,579) (actual time=29.047..33.655 rows=1,540 loops=1)

  • Hash Cond: (m18_.id = m0_.id)
20. 1.605 1.605 ↑ 1.0 24,005 1

Seq Scan on ma_pulse_measurement m18_ (cost=0.00..347.05 rows=24,005 width=8) (actual time=0.015..1.605 rows=24,005 loops=1)

21. 1.332 28.983 ↓ 1.1 1,540 1

Hash (cost=4,881.16..4,881.16 rows=1,379 width=2,575) (actual time=28.983..28.983 rows=1,540 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 303kB
22. 0.938 27.651 ↓ 1.1 1,540 1

Hash Left Join (cost=4,126.90..4,881.16 rows=1,379 width=2,575) (actual time=16.090..27.651 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m14_.id)
23. 1.075 26.662 ↓ 1.1 1,540 1

Hash Left Join (cost=4,122.62..4,873.25 rows=1,379 width=2,574) (actual time=16.024..26.662 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m12_.id)
24. 0.913 25.502 ↓ 1.1 1,540 1

Hash Left Join (cost=4,117.26..4,864.28 rows=1,379 width=2,510) (actual time=15.924..25.502 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m11_.id)
25. 0.915 24.503 ↓ 1.1 1,540 1

Hash Left Join (cost=4,105.83..4,849.22 rows=1,379 width=2,494) (actual time=15.827..24.503 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m10_.id)
26. 4.945 23.253 ↓ 1.1 1,540 1

Hash Right Join (cost=4,088.14..4,827.91 rows=1,379 width=2,459) (actual time=15.477..23.253 rows=1,540 loops=1)

  • Hash Cond: (m13_.id = m0_.id)
27. 2.856 2.856 ↑ 1.0 40,533 1

Seq Scan on ma_inspection_of_bedsores m13_ (cost=0.00..585.33 rows=40,533 width=5) (actual time=0.008..2.856 rows=40,533 loops=1)

28. 0.900 15.452 ↓ 1.1 1,540 1

Hash (cost=4,070.90..4,070.90 rows=1,379 width=2,458) (actual time=15.452..15.452 rows=1,540 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 302kB
29. 2.761 14.552 ↓ 1.1 1,540 1

Hash Right Join (cost=3,566.96..4,070.90 rows=1,379 width=2,458) (actual time=10.162..14.552 rows=1,540 loops=1)

  • Hash Cond: (m9_.id = m0_.id)
30. 1.678 1.678 ↑ 1.0 26,208 1

Seq Scan on ma_blood_pressure_measurement m9_ (cost=0.00..404.08 rows=26,208 width=12) (actual time=0.006..1.678 rows=26,208 loops=1)

31. 0.955 10.113 ↓ 1.1 1,540 1

Hash (cost=3,549.72..3,549.72 rows=1,379 width=2,450) (actual time=10.113..10.113 rows=1,540 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 301kB
32. 1.528 9.158 ↓ 1.1 1,540 1

Hash Right Join (cost=3,327.10..3,549.72 rows=1,379 width=2,450) (actual time=6.860..9.158 rows=1,540 loops=1)

  • Hash Cond: (m8_.id = m0_.id)
33. 0.789 0.789 ↑ 1.0 11,558 1

Seq Scan on ma_blood_sugar_measurement m8_ (cost=0.00..178.58 rows=11,558 width=14) (actual time=0.007..0.789 rows=11,558 loops=1)

34. 0.888 6.841 ↓ 1.1 1,540 1

Hash (cost=3,309.86..3,309.86 rows=1,379 width=2,440) (actual time=6.841..6.841 rows=1,540 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 301kB
35. 0.508 5.953 ↓ 1.1 1,540 1

Hash Left Join (cost=193.26..3,309.86 rows=1,379 width=2,440) (actual time=1.785..5.953 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m7_.id)
36. 0.470 5.269 ↓ 1.1 1,540 1

Hash Left Join (cost=169.68..3,282.66 rows=1,379 width=2,435) (actual time=1.598..5.269 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m6_.id)
37. 0.471 4.605 ↓ 1.1 1,540 1

Hash Left Join (cost=148.06..3,257.42 rows=1,379 width=2,431) (actual time=1.391..4.605 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m5_.id)
38. 0.474 4.132 ↓ 1.1 1,540 1

Hash Left Join (cost=113.98..3,219.72 rows=1,379 width=2,387) (actual time=1.380..4.132 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m4_.id)
39. 0.429 2.849 ↓ 1.1 1,540 1

Hash Left Join (cost=50.63..3,152.75 rows=1,379 width=2,307) (actual time=0.557..2.849 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m3_.id)
40. 0.368 2.411 ↓ 1.1 1,540 1

Hash Left Join (cost=49.29..3,147.79 rows=1,379 width=243) (actual time=0.539..2.411 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m2_.id)
41. 0.488 1.928 ↓ 1.1 1,540 1

Hash Left Join (cost=35.29..3,130.17 rows=1,379 width=237) (actual time=0.416..1.928 rows=1,540 loops=1)

  • Hash Cond: (m0_.id = m1_.id)
42. 1.163 1.344 ↓ 1.1 1,540 1

Bitmap Heap Scan on medical_activity m0_ (cost=27.11..3,118.37 rows=1,379 width=140) (actual time=0.317..1.344 rows=1,540 loops=1)

  • Recheck Cond: (admission_discharge_book_entry_id = 1)
  • Heap Blocks: exact=1,392
43. 0.181 0.181 ↓ 1.1 1,540 1

Bitmap Index Scan on idx_d0eee40db58e2186 (cost=0.00..26.76 rows=1,379 width=0) (actual time=0.181..0.181 rows=1,540 loops=1)

  • Index Cond: (admission_discharge_book_entry_id = 1)
44. 0.053 0.096 ↑ 1.0 186 1

Hash (cost=5.86..5.86 rows=186 width=101) (actual time=0.095..0.096 rows=186 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 35kB
45. 0.043 0.043 ↑ 1.0 186 1

Seq Scan on ma_abbreviated_mental_test_score m1_ (cost=0.00..5.86 rows=186 width=101) (actual time=0.008..0.043 rows=186 loops=1)

46. 0.063 0.115 ↑ 1.0 489 1

Hash (cost=7.89..7.89 rows=489 width=10) (actual time=0.115..0.115 rows=489 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 30kB
47. 0.052 0.052 ↑ 1.0 489 1

Seq Scan on ma_activities_of_daily_living m2_ (cost=0.00..7.89 rows=489 width=10) (actual time=0.005..0.052 rows=489 loops=1)

48. 0.005 0.009 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=2,068) (actual time=0.009..0.009 rows=15 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
49. 0.004 0.004 ↑ 1.0 15 1

Seq Scan on ma_allergies_check m3_ (cost=0.00..1.15 rows=15 width=2,068) (actual time=0.003..0.004 rows=15 loops=1)

50. 0.499 0.809 ↑ 1.0 1,749 1

Hash (cost=41.49..41.49 rows=1,749 width=84) (actual time=0.809..0.809 rows=1,749 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 215kB
51. 0.310 0.310 ↑ 1.0 1,749 1

Seq Scan on ma_scale_barthel_check m4_ (cost=0.00..41.49 rows=1,749 width=84) (actual time=0.006..0.310 rows=1,749 loops=1)

52. 0.000 0.002 ↓ 0.0 0 1

Hash (cost=20.70..20.70 rows=1,070 width=48) (actual time=0.002..0.002 rows=0 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 16kB
53. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on ma_scale_barthel_adl_check m5_ (cost=0.00..20.70 rows=1,070 width=48) (actual time=0.002..0.002 rows=0 loops=1)

54. 0.127 0.194 ↓ 1.0 784 1

Hash (cost=11.83..11.83 rows=783 width=8) (actual time=0.194..0.194 rows=784 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 39kB
55. 0.067 0.067 ↓ 1.0 784 1

Seq Scan on ma_body_height_measurement m6_ (cost=0.00..11.83 rows=783 width=8) (actual time=0.005..0.067 rows=784 loops=1)

56. 0.106 0.176 ↓ 1.0 827 1

Hash (cost=13.26..13.26 rows=826 width=9) (actual time=0.176..0.176 rows=827 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 44kB
57. 0.070 0.070 ↓ 1.0 827 1

Seq Scan on ma_body_weight_measurement m7_ (cost=0.00..13.26 rows=826 width=9) (actual time=0.004..0.070 rows=827 loops=1)

58. 0.202 0.335 ↓ 1.0 566 1

Hash (cost=10.64..10.64 rows=564 width=39) (actual time=0.335..0.335 rows=566 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 49kB
59. 0.133 0.133 ↓ 1.0 566 1

Seq Scan on ma_first_interview m10_ (cost=0.00..10.64 rows=564 width=39) (actual time=0.006..0.133 rows=566 loops=1)

60. 0.047 0.086 ↑ 1.0 375 1

Hash (cost=6.75..6.75 rows=375 width=20) (actual time=0.086..0.086 rows=375 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
61. 0.039 0.039 ↑ 1.0 375 1

Seq Scan on ma_scale_glasgow_check m11_ (cost=0.00..6.75 rows=375 width=20) (actual time=0.005..0.039 rows=375 loops=1)

62. 0.048 0.085 ↑ 1.0 149 1

Hash (cost=3.49..3.49 rows=149 width=68) (actual time=0.085..0.085 rows=149 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 23kB
63. 0.037 0.037 ↑ 1.0 149 1

Seq Scan on ma_scale_geriatric_depression_check m12_ (cost=0.00..3.49 rows=149 width=68) (actual time=0.004..0.037 rows=149 loops=1)

64. 0.028 0.051 ↑ 1.0 146 1

Hash (cost=2.46..2.46 rows=146 width=5) (actual time=0.051..0.051 rows=146 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 14kB
65. 0.023 0.023 ↑ 1.0 146 1

Seq Scan on ma_inspection_of_wounds m14_ (cost=0.00..2.46 rows=146 width=5) (actual time=0.006..0.023 rows=146 loops=1)

66. 0.095 0.129 ↑ 1.0 177 1

Hash (cost=23.77..23.77 rows=177 width=881) (actual time=0.129..0.129 rows=177 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 167kB
67. 0.034 0.034 ↑ 1.0 177 1

Seq Scan on ma_laboratory_diagnostic m15_ (cost=0.00..23.77 rows=177 width=881) (actual time=0.004..0.034 rows=177 loops=1)

68. 0.489 0.871 ↑ 1.0 4,521 1

Hash (cost=66.21..66.21 rows=4,521 width=8) (actual time=0.871..0.871 rows=4,521 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 241kB
69. 0.382 0.382 ↑ 1.0 4,521 1

Seq Scan on ma_saturation_measurement m19_ (cost=0.00..66.21 rows=4,521 width=8) (actual time=0.006..0.382 rows=4,521 loops=1)

70. 0.468 0.838 ↑ 1.0 3,109 1

Hash (cost=54.09..54.09 rows=3,109 width=28) (actual time=0.838..0.838 rows=3,109 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 215kB
71. 0.370 0.370 ↑ 1.0 3,109 1

Seq Scan on ma_scale_norton_check m20_ (cost=0.00..54.09 rows=3,109 width=28) (actual time=0.006..0.370 rows=3,109 loops=1)

72. 0.000 0.002 ↓ 0.0 0 1

Hash (cost=28.10..28.10 rows=1,810 width=17) (actual time=0.002..0.002 rows=0 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 16kB
73. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on ma_nutritional_risk_score m21_ (cost=0.00..28.10 rows=1,810 width=17) (actual time=0.002..0.002 rows=0 loops=1)

74. 6.389 10.368 ↓ 1.0 33,501 1

Hash (cost=517.00..517.00 rows=33,500 width=10) (actual time=10.368..10.368 rows=33,501 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 1,952kB
75. 3.979 3.979 ↓ 1.0 33,501 1

Seq Scan on ma_temperature_measurement m22_ (cost=0.00..517.00 rows=33,500 width=10) (actual time=0.005..3.979 rows=33,501 loops=1)

76. 0.257 0.462 ↑ 1.0 616 1

Hash (cost=15.16..15.16 rows=616 width=84) (actual time=0.462..0.462 rows=616 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 78kB
77. 0.205 0.205 ↑ 1.0 616 1

Seq Scan on ma_scale_tinetti_check m23_ (cost=0.00..15.16 rows=616 width=84) (actual time=0.009..0.205 rows=616 loops=1)

78. 0.000 0.003 ↓ 0.0 0 1

Hash (cost=10.10..10.10 rows=10 width=5,172) (actual time=0.003..0.003 rows=0 loops=1)

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

Seq Scan on ma_subjective_global_assessment m24_ (cost=0.00..10.10 rows=10 width=5,172) (actual time=0.003..0.003 rows=0 loops=1)

80. 0.000 0.002 ↓ 0.0 0 1

Hash (cost=22.00..22.00 rows=1,200 width=40) (actual time=0.002..0.002 rows=0 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 16kB
81. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on ma_performed_procedure m25_ (cost=0.00..22.00 rows=1,200 width=40) (actual time=0.002..0.002 rows=0 loops=1)

82. 0.001 0.002 ↓ 0.0 0 1

Hash (cost=30.40..30.40 rows=2,040 width=12) (actual time=0.002..0.002 rows=0 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 16kB
83. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on ma_scale_modified_rankin_check m26_ (cost=0.00..30.40 rows=2,040 width=12) (actual time=0.001..0.001 rows=0 loops=1)

84. 0.000 0.002 ↓ 0.0 0 1

Hash (cost=32.60..32.60 rows=2,260 width=8) (actual time=0.002..0.002 rows=0 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 32kB
85. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on ma_scale_visual_analogue_check m27_ (cost=0.00..32.60 rows=2,260 width=8) (actual time=0.002..0.002 rows=0 loops=1)

Planning time : 219.753 ms
Execution time : 91.514 ms