explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VLmT

Settings
# exclusive inclusive rows x rows loops node
1. 5,229.202 5,229.343 ↓ 0.0 0 1

Limit (cost=4,864,841,368,847,929,005,047,808.00..4,864,841,368,847,929,005,047,808.00 rows=1 width=10,202) (actual time=5,229.316..5,229.343 rows=0 loops=1)

  • Functions: 212
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 29.523 ms, Inlining 9.132 ms, Optimization 2386.304 ms, Emission 2832.046 ms, Total 5257.006 ms
2. 0.043 0.141 ↓ 0.0 0 1

Sort (cost=4,864,841,368,847,929,005,047,808.00..7,239,132,102,478,596,979,818,496.00 rows=949,716,293,452,267,138,368,667,648 width=10,202) (actual time=0.117..0.141 rows=0 loops=1)

  • Sort Key: m0_.performed_at DESC, m0_.id DESC
  • Sort Method: quicksort Memory: 25kB
3. 0.001 0.098 ↓ 0.0 0 1

Hash Left Join (cost=1,059.35..116,259,901,586,590,673,141,760.00 rows=949,716,293,452,267,138,368,667,648 width=10,202) (actual time=0.075..0.098 rows=0 loops=1)

  • Hash Cond: (m0_.id = m27_.id)
4. 0.002 0.097 ↓ 0.0 0 1

Hash Left Join (cost=998.50..5,743,073,630,794,783,129,600.00 rows=42,022,844,843,020,667,330,756,608 width=10,198) (actual time=0.073..0.097 rows=0 loops=1)

  • Hash Cond: (m0_.id = m26_.id)
5. 0.004 0.095 ↓ 0.0 0 1

Hash Left Join (cost=942.60..324,488,512,492,824,952,832.00 rows=2,059,943,374,657,875,639,009,280 width=10,190) (actual time=0.073..0.095 rows=0 loops=1)

  • Hash Cond: (m0_.id = m22_.id)
6. 0.007 0.091 ↓ 0.0 0 1

Hash Left Join (cost=890.98..31,529,655,422,689,759,232.00 rows=111,348,290,522,047,332,745,216 width=10,178) (actual time=0.069..0.091 rows=0 loops=1)

  • Hash Cond: (m0_.id = m25_.id)
7. 0.001 0.084 ↓ 0.0 0 1

Hash Left Join (cost=853.98..7,086,192,584,043,452,416.00 rows=9,279,024,210,170,610,712,576 width=10,142) (actual time=0.065..0.084 rows=0 loops=1)

  • Hash Cond: (m0_.id = m23_.id)
8. 0.001 0.083 ↓ 0.0 0 1

Hash Left Join (cost=827.78..3,683,301,978,032,533,504.00 rows=1,288,753,362,523,695,874,048 width=10,062) (actual time=0.064..0.083 rows=0 loops=1)

  • Hash Cond: (m0_.id = m24_.id)
9. 0.004 0.082 ↓ 0.0 0 1

Hash Left Join (cost=817.55..156,950,589,827,070,112.00 rows=1,288,753,362,523,695,874,048 width=4,894) (actual time=0.064..0.082 rows=0 loops=1)

  • Hash Cond: (m0_.id = m19_.id)
10. 0.001 0.078 ↓ 0.0 0 1

Hash Left Join (cost=756.70..6,980,609,712,536,752.00 rows=57,024,485,067,420,172,288 width=4,890) (actual time=0.060..0.078 rows=0 loops=1)

  • Hash Cond: (m0_.id = m18_.id)
11. 0.004 0.077 ↓ 0.0 0 1

Hash Left Join (cost=695.85..344,769,884,459,996.69 rows=2,523,207,303,868,149,248 width=4,886) (actual time=0.060..0.077 rows=0 loops=1)

  • Hash Cond: (m0_.id = m16_.id)
12. 0.001 0.073 ↓ 0.0 0 1

Hash Left Join (cost=639.95..19,417,957,473,458.33 rows=123,686,632,542,556,144 width=4,878) (actual time=0.056..0.073 rows=0 loops=1)

  • Hash Cond: (m0_.id = m21_.id)
13. 0.001 0.072 ↓ 0.0 0 1

Hash Left Join (cost=589.23..1,437,977,416,179.32 rows=6,833,515,610,085,975 width=4,865) (actual time=0.055..0.072 rows=0 loops=1)

  • Hash Cond: (m0_.id = m20_.id)
14. 0.011 0.071 ↓ 0.0 0 1

Hash Left Join (cost=546.60..197,259,620,557.53 rows=471,276,938,626,619 width=4,841) (actual time=0.055..0.071 rows=0 loops=1)

  • Hash Cond: (m0_.id = m17_.id)
15. 0.001 0.060 ↓ 0.0 0 1

Hash Left Join (cost=511.63..85,383,463,078.72 rows=42,457,381,858,254 width=4,800) (actual time=0.051..0.060 rows=0 loops=1)

  • Hash Cond: (m0_.id = m15_.id)
16. 0.001 0.059 ↓ 0.0 0 1

Hash Left Join (cost=498.48..3,365,982,422.30 rows=30,326,701,327,324 width=4,252) (actual time=0.051..0.059 rows=0 loops=1)

  • Hash Cond: (m0_.id = m14_.id)
17. 0.004 0.058 ↓ 0.0 0 1

Hash Left Join (cost=432.90..137,472,886.26 rows=1,227,801,673,171 width=4,251) (actual time=0.050..0.058 rows=0 loops=1)

  • Hash Cond: (m0_.id = m13_.id)
18. 0.001 0.054 ↓ 0.0 0 1

Hash Left Join (cost=367.33..6,763,935.24 rows=49,708,569,764 width=4,250) (actual time=0.047..0.054 rows=0 loops=1)

  • Hash Cond: (m0_.id = m9_.id)
19. 0.004 0.053 ↓ 0.0 0 1

Hash Left Join (cost=311.43..354,267.83 rows=2,436,694,541 width=4,242) (actual time=0.047..0.053 rows=0 loops=1)

  • Hash Cond: (m0_.id = m8_.id)
20. 0.001 0.049 ↓ 0.0 0 1

Hash Left Join (cost=257.78..23,786.37 rows=125,602,868 width=4,232) (actual time=0.043..0.049 rows=0 loops=1)

  • Hash Cond: (m0_.id = m11_.id)
21. 0.001 0.048 ↓ 0.0 0 1

Hash Left Join (cost=209.53..4,295.21 rows=7,388,404 width=4,216) (actual time=0.043..0.048 rows=0 loops=1)

  • Hash Cond: (m0_.id = m12_.id)
22. 0.001 0.047 ↓ 0.0 0 1

Hash Left Join (cost=180.40..1,972.99 rows=869,224 width=4,152) (actual time=0.042..0.047 rows=0 loops=1)

  • Hash Cond: (m0_.id = m10_.id)
23. 0.004 0.046 ↓ 0.0 0 1

Hash Left Join (cost=167.25..280.71 rows=620,874 width=3,609) (actual time=0.042..0.046 rows=0 loops=1)

  • Hash Cond: (m0_.id = m2_.id)
24. 0.002 0.042 ↓ 0.0 0 1

Hash Left Join (cost=109.10..146.78 rows=28,815 width=3,603) (actual time=0.038..0.042 rows=0 loops=1)

  • Hash Cond: (m0_.id = m7_.id)
25. 0.001 0.040 ↓ 0.0 0 1

Hash Left Join (cost=60.85..94.07 rows=1,695 width=3,587) (actual time=0.037..0.040 rows=0 loops=1)

  • Hash Cond: (m0_.id = m5_.id)
26. 0.001 0.039 ↓ 0.0 0 1

Hash Left Join (cost=26.78..59.58 rows=158 width=3,543) (actual time=0.037..0.039 rows=0 loops=1)

  • Hash Cond: (m0_.id = m4_.id)
27. 0.001 0.038 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.58..33.32 rows=23 width=3,463) (actual time=0.036..0.038 rows=0 loops=1)

28. 0.001 0.037 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.42..25.14 rows=1 width=3,459) (actual time=0.035..0.037 rows=0 loops=1)

29. 0.002 0.036 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.29..16.46 rows=1 width=1,395) (actual time=0.035..0.036 rows=0 loops=1)

30. 0.034 0.034 ↓ 0.0 0 1

Index Scan using idx_d0eee40db58e2186 on medical_activity m0_ (cost=0.14..8.16 rows=1 width=717) (actual time=0.034..0.034 rows=0 loops=1)

  • Index Cond: (admission_discharge_book_entry_id = 1)
31. 0.000 0.000 ↓ 0.0 0

Index Scan using ma_abbreviated_mental_test_score_pkey on ma_abbreviated_mental_test_score m1_ (cost=0.14..8.16 rows=1 width=682) (never executed)

  • Index Cond: (id = m0_.id)
32. 0.000 0.000 ↓ 0.0 0

Index Scan using ma_allergies_check_pkey on ma_allergies_check m3_ (cost=0.14..8.15 rows=1 width=2,068) (never executed)

  • Index Cond: (id = m0_.id)
33. 0.000 0.000 ↓ 0.0 0

Index Scan using ma_body_height_measurement_pkey on ma_body_height_measurement m6_ (cost=0.15..8.17 rows=1 width=8) (never executed)

  • Index Cond: (id = m0_.id)
34. 0.000 0.000 ↓ 0.0 0

Hash (cost=17.20..17.20 rows=720 width=84) (never executed)

35. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_scale_barthel_check m4_ (cost=0.00..17.20 rows=720 width=84) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Hash (cost=20.70..20.70 rows=1,070 width=48) (never executed)

37. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_scale_barthel_adl_check m5_ (cost=0.00..20.70 rows=1,070 width=48) (never executed)

38. 0.000 0.000 ↓ 0.0 0

Hash (cost=27.00..27.00 rows=1,700 width=20) (never executed)

39. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_body_weight_measurement m7_ (cost=0.00..27.00 rows=1,700 width=20) (never executed)

40. 0.000 0.000 ↓ 0.0 0

Hash (cost=31.40..31.40 rows=2,140 width=10) (never executed)

41. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_activities_of_daily_living m2_ (cost=0.00..31.40 rows=2,140 width=10) (never executed)

42. 0.000 0.000 ↓ 0.0 0

Hash (cost=11.40..11.40 rows=140 width=547) (never executed)

43. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_first_interview m10_ (cost=0.00..11.40 rows=140 width=547) (never executed)

44. 0.000 0.000 ↓ 0.0 0

Hash (cost=18.50..18.50 rows=850 width=68) (never executed)

45. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_scale_geriatric_depression_check m12_ (cost=0.00..18.50 rows=850 width=68) (never executed)

46. 0.000 0.000 ↓ 0.0 0

Hash (cost=27.00..27.00 rows=1,700 width=20) (never executed)

47. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_scale_glasgow_check m11_ (cost=0.00..27.00 rows=1,700 width=20) (never executed)

48. 0.000 0.000 ↓ 0.0 0

Hash (cost=29.40..29.40 rows=1,940 width=14) (never executed)

49. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_blood_sugar_measurement m8_ (cost=0.00..29.40 rows=1,940 width=14) (never executed)

50. 0.000 0.000 ↓ 0.0 0

Hash (cost=30.40..30.40 rows=2,040 width=12) (never executed)

51. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_blood_pressure_measurement m9_ (cost=0.00..30.40 rows=2,040 width=12) (never executed)

52. 0.000 0.000 ↓ 0.0 0

Hash (cost=34.70..34.70 rows=2,470 width=5) (never executed)

53. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_inspection_of_bedsores m13_ (cost=0.00..34.70 rows=2,470 width=5) (never executed)

54. 0.000 0.000 ↓ 0.0 0

Hash (cost=34.70..34.70 rows=2,470 width=5) (never executed)

55. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_inspection_of_wounds m14_ (cost=0.00..34.70 rows=2,470 width=5) (never executed)

56. 0.000 0.000 ↓ 0.0 0

Hash (cost=11.40..11.40 rows=140 width=552) (never executed)

57. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_laboratory_diagnostic m15_ (cost=0.00..11.40 rows=140 width=552) (never executed)

58. 0.000 0.000 ↓ 0.0 0

Hash (cost=21.10..21.10 rows=1,110 width=45) (never executed)

59. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_nurse_observation m17_ (cost=0.00..21.10 rows=1,110 width=45) (never executed)

60. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.50..24.50 rows=1,450 width=28) (never executed)

61. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_scale_norton_check m20_ (cost=0.00..24.50 rows=1,450 width=28) (never executed)

62. 0.000 0.000 ↓ 0.0 0

Hash (cost=28.10..28.10 rows=1,810 width=17) (never executed)

63. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_nutritional_risk_score m21_ (cost=0.00..28.10 rows=1,810 width=17) (never executed)

64. 0.000 0.000 ↓ 0.0 0

Hash (cost=30.40..30.40 rows=2,040 width=12) (never executed)

65. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_liquid_measurement m16_ (cost=0.00..30.40 rows=2,040 width=12) (never executed)

66. 0.000 0.000 ↓ 0.0 0

Hash (cost=32.60..32.60 rows=2,260 width=8) (never executed)

67. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_pulse_measurement m18_ (cost=0.00..32.60 rows=2,260 width=8) (never executed)

68. 0.000 0.000 ↓ 0.0 0

Hash (cost=32.60..32.60 rows=2,260 width=8) (never executed)

69. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_saturation_measurement m19_ (cost=0.00..32.60 rows=2,260 width=8) (never executed)

70. 0.000 0.000 ↓ 0.0 0

Hash (cost=10.10..10.10 rows=10 width=5,172) (never executed)

71. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_subjective_global_assessment m24_ (cost=0.00..10.10 rows=10 width=5,172) (never executed)

72. 0.000 0.000 ↓ 0.0 0

Hash (cost=17.20..17.20 rows=720 width=84) (never executed)

73. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_scale_tinetti_check m23_ (cost=0.00..17.20 rows=720 width=84) (never executed)

74. 0.000 0.000 ↓ 0.0 0

Hash (cost=22.00..22.00 rows=1,200 width=40) (never executed)

75. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_performed_procedure m25_ (cost=0.00..22.00 rows=1,200 width=40) (never executed)

76. 0.000 0.000 ↓ 0.0 0

Hash (cost=28.50..28.50 rows=1,850 width=16) (never executed)

77. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_temperature_measurement m22_ (cost=0.00..28.50 rows=1,850 width=16) (never executed)

78. 0.000 0.000 ↓ 0.0 0

Hash (cost=30.40..30.40 rows=2,040 width=12) (never executed)

79. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_scale_modified_rankin_check m26_ (cost=0.00..30.40 rows=2,040 width=12) (never executed)

80. 0.000 0.000 ↓ 0.0 0

Hash (cost=32.60..32.60 rows=2,260 width=8) (never executed)

81. 0.000 0.000 ↓ 0.0 0

Seq Scan on ma_scale_visual_analogue_check m27_ (cost=0.00..32.60 rows=2,260 width=8) (never executed)

Planning time : 52.155 ms
Execution time : 5,260.510 ms