explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gNH2

Settings
# exclusive inclusive rows x rows loops node
1. 3.590 1,304.488 ↓ 1.2 157 1

Subquery Scan on __local_0__ (cost=7.92..322,252.93 rows=131 width=672) (actual time=1,250.846..1,304.488 rows=157 loops=1)

2. 0.237 1,250.187 ↓ 1.2 157 1

Sort (cost=7.92..8.24 rows=131 width=93) (actual time=1,250.134..1,250.187 rows=157 loops=1)

  • Sort Key: __local_0___1.id
  • Sort Method: quicksort Memory: 38kB
3. 1,249.950 1,249.950 ↓ 1.2 157 1

Seq Scan on test_orders __local_0___1 (cost=0.00..3.31 rows=131 width=93) (actual time=1,249.841..1,249.950 rows=157 loops=1)

4.          

SubPlan (for Subquery Scan)

5. 0.314 0.314 ↓ 0.0 0 157

Index Scan using test_results_pkey on test_results __local_1__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.001..0.002 rows=0 loops=157)

  • Index Cond: (value = __local_0__.initial_result_value)
6. 0.157 0.157 ↓ 0.0 0 157

Index Scan using test_results_pkey on test_results __local_2__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=157)

  • Index Cond: (value = __local_0__.final_result_value)
7. 0.444 0.628 ↓ 0.0 0 157

Index Scan using users_pkey on users __local_3__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.003..0.004 rows=0 loops=157)

  • Index Cond: (id = __local_0__.entered_by_id)
8.          

SubPlan (for Index Scan)

9. 0.184 0.184 ↑ 1.0 1 23

Index Scan using orgs_pkey on orgs __local_4__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.008..0.008 rows=1 loops=23)

  • Index Cond: (id = __local_3__.org_id)
10. 0.199 0.314 ↓ 0.0 0 157

Index Scan using users_pkey on users __local_5__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.002..0.002 rows=0 loops=157)

  • Index Cond: (id = __local_0__.validated_by_id)
11.          

SubPlan (for Index Scan)

12. 0.115 0.115 ↑ 1.0 1 23

Index Scan using orgs_pkey on orgs __local_6__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=23)

  • Index Cond: (id = __local_5__.org_id)
13. 2.198 10.048 ↑ 1.0 1 157

Seq Scan on tests __local_7__ (cost=0.00..37.34 rows=1 width=32) (actual time=0.063..0.064 rows=1 loops=157)

  • Filter: (__local_0__.test_id = id)
  • Rows Removed by Filter: 24
14.          

SubPlan (for Seq Scan)

15. 0.157 0.157 ↓ 0.0 0 157

Index Scan using labs_pkey on labs __local_8__ (cost=0.14..8.16 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=157)

  • Index Cond: (id = __local_7__.reference_lab_id)
16. 0.157 2.198 ↑ 1.0 1 157

Result (cost=1.35..1.36 rows=1 width=32) (actual time=0.014..0.014 rows=1 loops=157)

17.          

Initplan (for Result)

18. 0.314 2.041 ↑ 1.0 1 157

Aggregate (cost=1.34..1.35 rows=1 width=32) (actual time=0.013..0.013 rows=1 loops=157)

19. 0.628 1.727 ↓ 0.0 0 157

Sort (cost=1.32..1.33 rows=1 width=314) (actual time=0.011..0.011 rows=0 loops=157)

  • Sort Key: __local_10__.id
  • Sort Method: quicksort Memory: 25kB
20. 1.099 1.099 ↓ 0.0 0 157

Seq Scan on tests __local_10__ (cost=0.00..1.31 rows=1 width=314) (actual time=0.007..0.007 rows=0 loops=157)

  • Filter: (parent_id = __local_7__.id)
  • Rows Removed by Filter: 25
21. 0.157 5.495 ↑ 1.0 1 157

Result (cost=26.49..26.50 rows=1 width=32) (actual time=0.035..0.035 rows=1 loops=157)

22.          

Initplan (for Result)

23. 1.104 5.338 ↑ 1.0 1 157

Aggregate (cost=26.48..26.49 rows=1 width=32) (actual time=0.034..0.034 rows=1 loops=157)

24. 0.628 1.884 ↑ 1.0 3 157

Sort (cost=1.91..1.92 rows=3 width=11) (actual time=0.012..0.012 rows=3 loops=157)

  • Sort Key: __local_13__.id
  • Sort Method: quicksort Memory: 25kB
25. 1.256 1.256 ↑ 1.0 3 157

Seq Scan on tests_test_results __local_13__ (cost=0.00..1.89 rows=3 width=11) (actual time=0.005..0.008 rows=3 loops=157)

  • Filter: (test_id = __local_7__.id)
  • Rows Removed by Filter: 68
26.          

SubPlan (for Aggregate)

27. 2.350 2.350 ↑ 1.0 1 470

Index Scan using test_results_pkey on test_results __local_12__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.004..0.005 rows=1 loops=470)

  • Index Cond: (value = __local_13__.result)
28. 1.083 1.413 ↓ 0.0 0 157

Seq Scan on samples __local_14__ (cost=0.00..34.33 rows=1 width=32) (actual time=0.008..0.009 rows=0 loops=157)

  • Filter: (__local_0__.sample_id = id)
  • Rows Removed by Filter: 52
29.          

SubPlan (for Seq Scan)

30. 0.102 0.102 ↑ 1.0 1 6

Index Scan using tube_types_pkey on tube_types __local_15__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.017..0.017 rows=1 loops=6)

  • Index Cond: (value = __local_14__.type_id)
31. 0.072 0.168 ↑ 1.0 1 6

Index Scan using tubes_pkey on tubes __local_16__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.027..0.028 rows=1 loops=6)

  • Index Cond: (id = __local_14__.tube_id)
32.          

SubPlan (for Index Scan)

33. 0.096 0.096 ↑ 1.0 1 6

Index Scan using specimen_types_pkey on specimen_types __local_17__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.015..0.016 rows=1 loops=6)

  • Index Cond: (value = __local_16__.specimen_type_id)
34. 0.060 0.060 ↑ 1.0 1 6

Index Scan using transfusion_pkey on transfusion __local_18__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.010..0.010 rows=1 loops=6)

  • Index Cond: (value = __local_14__.transfusion_id)
35. 0.314 30.615 ↑ 1.0 1 157

Result (cost=491.51..491.52 rows=1 width=32) (actual time=0.195..0.195 rows=1 loops=157)

36.          

Initplan (for Result)

37. 3.820 30.301 ↑ 1.0 1 157

Aggregate (cost=491.50..491.51 rows=1 width=32) (actual time=0.193..0.193 rows=1 loops=157)

38. 0.628 3.297 ↑ 1.0 1 157

Sort (cost=4.31..4.32 rows=1 width=91) (actual time=0.021..0.021 rows=1 loops=157)

  • Sort Key: __local_20__.id
  • Sort Method: quicksort Memory: 25kB
39. 2.669 2.669 ↑ 1.0 1 157

Seq Scan on test_order_results __local_20__ (cost=0.00..4.30 rows=1 width=91) (actual time=0.010..0.017 rows=1 loops=157)

  • Filter: (test_order_id = __local_0__.id)
  • Rows Removed by Filter: 183
40.          

SubPlan (for Aggregate)

41. 1.656 12.512 ↑ 1.0 1 184

Index Scan using test_result_sets_pkey on test_result_sets __local_21__ (cost=0.15..45.51 rows=1 width=32) (actual time=0.067..0.068 rows=1 loops=184)

  • Index Cond: (id = __local_20__.test_result_set_id)
42.          

SubPlan (for Index Scan)

43. 2.392 10.856 ↑ 1.0 1 184

Seq Scan on tests __local_22__ (cost=0.00..37.34 rows=1 width=32) (actual time=0.058..0.059 rows=1 loops=184)

  • Filter: (__local_21__.test_id = id)
  • Rows Removed by Filter: 24
44.          

SubPlan (for Seq Scan)

45. 0.184 0.184 ↓ 0.0 0 184

Index Scan using labs_pkey on labs __local_23__ (cost=0.14..8.16 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=184)

  • Index Cond: (id = __local_22__.reference_lab_id)
46. 0.184 2.392 ↑ 1.0 1 184

Result (cost=1.35..1.36 rows=1 width=32) (actual time=0.013..0.013 rows=1 loops=184)

47.          

Initplan (for Result)

48. 0.368 2.208 ↑ 1.0 1 184

Aggregate (cost=1.34..1.35 rows=1 width=32) (actual time=0.012..0.012 rows=1 loops=184)

49. 0.736 1.840 ↓ 0.0 0 184

Sort (cost=1.32..1.33 rows=1 width=314) (actual time=0.009..0.010 rows=0 loops=184)

  • Sort Key: __local_25__.id
  • Sort Method: quicksort Memory: 25kB
50. 1.104 1.104 ↓ 0.0 0 184

Seq Scan on tests __local_25__ (cost=0.00..1.31 rows=1 width=314) (actual time=0.006..0.006 rows=0 loops=184)

  • Filter: (parent_id = __local_22__.id)
  • Rows Removed by Filter: 25
51. 0.368 5.888 ↑ 1.0 1 184

Result (cost=26.49..26.50 rows=1 width=32) (actual time=0.032..0.032 rows=1 loops=184)

52.          

Initplan (for Result)

53. 1.332 5.520 ↑ 1.0 1 184

Aggregate (cost=26.48..26.49 rows=1 width=32) (actual time=0.030..0.030 rows=1 loops=184)

54. 0.552 2.024 ↑ 1.0 3 184

Sort (cost=1.91..1.92 rows=3 width=11) (actual time=0.011..0.011 rows=3 loops=184)

  • Sort Key: __local_28__.id
  • Sort Method: quicksort Memory: 25kB
55. 1.472 1.472 ↑ 1.0 3 184

Seq Scan on tests_test_results __local_28__ (cost=0.00..1.89 rows=3 width=11) (actual time=0.005..0.008 rows=3 loops=184)

  • Filter: (test_id = __local_22__.id)
  • Rows Removed by Filter: 68
56.          

SubPlan (for Aggregate)

57. 2.164 2.164 ↑ 1.0 1 541

Index Scan using test_results_pkey on test_results __local_27__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=541)

  • Index Cond: (value = __local_28__.result)
58. 0.184 0.184 ↓ 0.0 0 184

Index Scan using test_results_pkey on test_results __local_29__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=184)

  • Index Cond: (value = __local_20__.result_1_id)
59. 0.184 0.184 ↓ 0.0 0 184

Index Scan using users_pkey on users __local_30__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=184)

  • Index Cond: (id = __local_20__.result_1_by_id)
60. 0.184 0.184 ↓ 0.0 0 184

Index Scan using test_results_pkey on test_results __local_31__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=184)

  • Index Cond: (value = __local_20__.result_2_id)
61. 0.000 0.000 ↓ 0.0 0 184

Index Scan using users_pkey on users __local_32__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.000..0.000 rows=0 loops=184)

  • Index Cond: (id = __local_20__.result_2_by_id)
62. 0.184 0.184 ↓ 0.0 0 184

Index Scan using test_results_pkey on test_results __local_33__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=184)

  • Index Cond: (value = __local_20__.result_final_id)
63. 1.072 1.288 ↓ 0.0 0 184

Seq Scan on samples __local_34__ (cost=0.00..34.33 rows=1 width=32) (actual time=0.007..0.007 rows=0 loops=184)

  • Filter: (__local_20__.sample_id = id)
  • Rows Removed by Filter: 52
64.          

SubPlan (for Seq Scan)

65. 0.030 0.030 ↑ 1.0 1 6

Index Scan using tube_types_pkey on tube_types __local_35__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.004..0.005 rows=1 loops=6)

  • Index Cond: (value = __local_34__.type_id)
66. 0.066 0.114 ↑ 1.0 1 6

Index Scan using tubes_pkey on tubes __local_36__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.018..0.019 rows=1 loops=6)

  • Index Cond: (id = __local_34__.tube_id)
67.          

SubPlan (for Index Scan)

68. 0.048 0.048 ↑ 1.0 1 6

Index Scan using specimen_types_pkey on specimen_types __local_37__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.007..0.008 rows=1 loops=6)

  • Index Cond: (value = __local_36__.specimen_type_id)
69. 0.072 0.072 ↑ 1.0 1 6

Index Scan using transfusion_pkey on transfusion __local_38__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.012..0.012 rows=1 loops=6)

  • Index Cond: (value = __local_34__.transfusion_id)
70. 0.368 8.648 ↑ 1.0 1 184

Result (cost=366.46..366.47 rows=1 width=32) (actual time=0.047..0.047 rows=1 loops=184)

71.          

Initplan (for Result)

72. 0.792 8.280 ↑ 1.0 1 184

Aggregate (cost=366.45..366.46 rows=1 width=32) (actual time=0.045..0.045 rows=1 loops=184)

73. 0.552 5.520 ↓ 0.0 0 184

Sort (cost=4.32..4.33 rows=3 width=91) (actual time=0.030..0.030 rows=0 loops=184)

  • Sort Key: __local_40__.id
  • Sort Method: quicksort Memory: 25kB
74. 4.968 4.968 ↓ 0.0 0 184

Seq Scan on test_order_results __local_40__ (cost=0.00..4.30 rows=3 width=91) (actual time=0.026..0.027 rows=0 loops=184)

  • Filter: (parent_result_id = __local_20__.id)
  • Rows Removed by Filter: 184
75.          

SubPlan (for Aggregate)

76. 0.192 1.680 ↑ 1.0 1 24

Index Scan using test_result_sets_pkey on test_result_sets __local_41__ (cost=0.15..45.51 rows=1 width=32) (actual time=0.070..0.070 rows=1 loops=24)

  • Index Cond: (id = __local_40__.test_result_set_id)
77.          

SubPlan (for Index Scan)

78. 0.336 1.488 ↑ 1.0 1 24

Seq Scan on tests __local_42__ (cost=0.00..37.34 rows=1 width=32) (actual time=0.060..0.062 rows=1 loops=24)

  • Filter: (__local_41__.test_id = id)
  • Rows Removed by Filter: 24
79.          

SubPlan (for Seq Scan)

80. 0.000 0.000 ↓ 0.0 0 24

Index Scan using labs_pkey on labs __local_43__ (cost=0.14..8.16 rows=1 width=32) (actual time=0.000..0.000 rows=0 loops=24)

  • Index Cond: (id = __local_42__.reference_lab_id)
81. 0.024 0.288 ↑ 1.0 1 24

Result (cost=1.35..1.36 rows=1 width=32) (actual time=0.012..0.012 rows=1 loops=24)

82.          

Initplan (for Result)

83. 0.024 0.264 ↑ 1.0 1 24

Aggregate (cost=1.34..1.35 rows=1 width=32) (actual time=0.011..0.011 rows=1 loops=24)

84. 0.072 0.240 ↓ 0.0 0 24

Sort (cost=1.32..1.33 rows=1 width=314) (actual time=0.010..0.010 rows=0 loops=24)

  • Sort Key: __local_45__.id
  • Sort Method: quicksort Memory: 25kB
85. 0.168 0.168 ↓ 0.0 0 24

Seq Scan on tests __local_45__ (cost=0.00..1.31 rows=1 width=314) (actual time=0.007..0.007 rows=0 loops=24)

  • Filter: (parent_id = __local_42__.id)
  • Rows Removed by Filter: 25
86. 0.024 0.864 ↑ 1.0 1 24

Result (cost=26.49..26.50 rows=1 width=32) (actual time=0.036..0.036 rows=1 loops=24)

87.          

Initplan (for Result)

88. 0.200 0.840 ↑ 1.0 1 24

Aggregate (cost=26.48..26.49 rows=1 width=32) (actual time=0.035..0.035 rows=1 loops=24)

89. 0.144 0.312 ↑ 1.0 3 24

Sort (cost=1.91..1.92 rows=3 width=11) (actual time=0.012..0.013 rows=3 loops=24)

  • Sort Key: __local_48__.id
  • Sort Method: quicksort Memory: 25kB
90. 0.168 0.168 ↑ 1.0 3 24

Seq Scan on tests_test_results __local_48__ (cost=0.00..1.89 rows=3 width=11) (actual time=0.004..0.007 rows=3 loops=24)

  • Filter: (test_id = __local_42__.id)
  • Rows Removed by Filter: 68
91.          

SubPlan (for Aggregate)

92. 0.328 0.328 ↑ 1.0 1 82

Index Scan using test_results_pkey on test_results __local_47__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=82)

  • Index Cond: (value = __local_48__.result)
93. 0.072 0.072 ↑ 1.0 1 24

Index Scan using test_results_pkey on test_results __local_49__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.002..0.003 rows=1 loops=24)

  • Index Cond: (value = __local_40__.result_1_id)
94. 0.000 0.000 ↓ 0.0 0 24

Index Scan using users_pkey on users __local_50__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.000..0.000 rows=0 loops=24)

  • Index Cond: (id = __local_40__.result_1_by_id)
95. 0.048 0.048 ↑ 1.0 1 24

Index Scan using test_results_pkey on test_results __local_51__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=24)

  • Index Cond: (value = __local_40__.result_2_id)
96. 0.000 0.000 ↓ 0.0 0 24

Index Scan using users_pkey on users __local_52__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.000..0.000 rows=0 loops=24)

  • Index Cond: (id = __local_40__.result_2_by_id)
97. 0.048 0.048 ↑ 1.0 1 24

Index Scan using test_results_pkey on test_results __local_53__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=24)

  • Index Cond: (value = __local_40__.result_final_id)
98. 0.120 0.120 ↓ 0.0 0 24

Seq Scan on samples __local_54__ (cost=0.00..34.33 rows=1 width=32) (actual time=0.005..0.005 rows=0 loops=24)

  • Filter: (__local_40__.sample_id = id)
  • Rows Removed by Filter: 52
99.          

SubPlan (for Seq Scan)

100. 0.000 0.000 ↓ 0.0 0

Index Scan using tube_types_pkey on tube_types __local_55__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_54__.type_id)
101. 0.000 0.000 ↓ 0.0 0

Index Scan using tubes_pkey on tubes __local_56__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_54__.tube_id)
102.          

SubPlan (for Index Scan)

103. 0.000 0.000 ↓ 0.0 0

Index Scan using specimen_types_pkey on specimen_types __local_57__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_56__.specimen_type_id)
104. 0.000 0.000 ↓ 0.0 0

Index Scan using transfusion_pkey on transfusion __local_58__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_54__.transfusion_id)
105. 0.471 5.024 ↑ 1.0 1 157

Result (cost=615.88..615.89 rows=1 width=32) (actual time=0.031..0.032 rows=1 loops=157)

106.          

Initplan (for Result)

107. 0.157 4.553 ↑ 1.0 1 157

Aggregate (cost=615.87..615.88 rows=1 width=32) (actual time=0.029..0.029 rows=1 loops=157)

108. 0.628 4.396 ↓ 0.0 0 157

Sort (cost=3.65..3.65 rows=1 width=93) (actual time=0.028..0.028 rows=0 loops=157)

  • Sort Key: __local_60__.id
  • Sort Method: quicksort Memory: 25kB
109. 3.768 3.768 ↓ 0.0 0 157

Seq Scan on test_orders __local_60__ (cost=0.00..3.64 rows=1 width=93) (actual time=0.024..0.024 rows=0 loops=157)

  • Filter: (original_order_id = __local_0__.id)
  • Rows Removed by Filter: 157
110.          

SubPlan (for Aggregate)

111. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_61__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_60__.initial_result_value)
112. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_62__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_60__.final_result_value)
113. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_63__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_60__.entered_by_id)
114.          

SubPlan (for Index Scan)

115. 0.000 0.000 ↓ 0.0 0

Index Scan using orgs_pkey on orgs __local_64__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_63__.org_id)
116. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_65__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_60__.validated_by_id)
117.          

SubPlan (for Index Scan)

118. 0.000 0.000 ↓ 0.0 0

Index Scan using orgs_pkey on orgs __local_66__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_65__.org_id)
119. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_67__ (cost=0.00..37.34 rows=1 width=32) (never executed)

  • Filter: (__local_60__.test_id = id)
120.          

SubPlan (for Seq Scan)

121. 0.000 0.000 ↓ 0.0 0

Index Scan using labs_pkey on labs __local_68__ (cost=0.14..8.16 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_67__.reference_lab_id)
122. 0.000 0.000 ↓ 0.0 0

Result (cost=1.35..1.36 rows=1 width=32) (never executed)

123.          

Initplan (for Result)

124. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.34..1.35 rows=1 width=32) (never executed)

125. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.32..1.33 rows=1 width=314) (never executed)

  • Sort Key: __local_70__.id
126. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_70__ (cost=0.00..1.31 rows=1 width=314) (never executed)

  • Filter: (parent_id = __local_67__.id)
127. 0.000 0.000 ↓ 0.0 0

Result (cost=26.49..26.50 rows=1 width=32) (never executed)

128.          

Initplan (for Result)

129. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=26.48..26.49 rows=1 width=32) (never executed)

130. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.91..1.92 rows=3 width=11) (never executed)

  • Sort Key: __local_73__.id
131. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests_test_results __local_73__ (cost=0.00..1.89 rows=3 width=11) (never executed)

  • Filter: (test_id = __local_67__.id)
132.          

SubPlan (for Aggregate)

133. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_72__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_73__.result)
134. 0.000 0.000 ↓ 0.0 0

Seq Scan on samples __local_74__ (cost=0.00..34.33 rows=1 width=32) (never executed)

  • Filter: (__local_60__.sample_id = id)
135.          

SubPlan (for Seq Scan)

136. 0.000 0.000 ↓ 0.0 0

Index Scan using tube_types_pkey on tube_types __local_75__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_74__.type_id)
137. 0.000 0.000 ↓ 0.0 0

Index Scan using tubes_pkey on tubes __local_76__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_74__.tube_id)
138.          

SubPlan (for Index Scan)

139. 0.000 0.000 ↓ 0.0 0

Index Scan using specimen_types_pkey on specimen_types __local_77__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_76__.specimen_type_id)
140. 0.000 0.000 ↓ 0.0 0

Index Scan using transfusion_pkey on transfusion __local_78__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_74__.transfusion_id)
141. 0.000 0.000 ↓ 0.0 0

Result (cost=491.51..491.52 rows=1 width=32) (never executed)

142.          

Initplan (for Result)

143. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=491.50..491.51 rows=1 width=32) (never executed)

144. 0.000 0.000 ↓ 0.0 0

Sort (cost=4.31..4.32 rows=1 width=91) (never executed)

  • Sort Key: __local_80__.id
145. 0.000 0.000 ↓ 0.0 0

Seq Scan on test_order_results __local_80__ (cost=0.00..4.30 rows=1 width=91) (never executed)

  • Filter: (test_order_id = __local_60__.id)
146.          

SubPlan (for Aggregate)

147. 0.000 0.000 ↓ 0.0 0

Index Scan using test_result_sets_pkey on test_result_sets __local_81__ (cost=0.15..45.51 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_80__.test_result_set_id)
148.          

SubPlan (for Index Scan)

149. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_82__ (cost=0.00..37.34 rows=1 width=32) (never executed)

  • Filter: (__local_81__.test_id = id)
150.          

SubPlan (for Seq Scan)

151. 0.000 0.000 ↓ 0.0 0

Index Scan using labs_pkey on labs __local_83__ (cost=0.14..8.16 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_82__.reference_lab_id)
152. 0.000 0.000 ↓ 0.0 0

Result (cost=1.35..1.36 rows=1 width=32) (never executed)

153.          

Initplan (for Result)

154. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.34..1.35 rows=1 width=32) (never executed)

155. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.32..1.33 rows=1 width=314) (never executed)

  • Sort Key: __local_85__.id
156. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_85__ (cost=0.00..1.31 rows=1 width=314) (never executed)

  • Filter: (parent_id = __local_82__.id)
157. 0.000 0.000 ↓ 0.0 0

Result (cost=26.49..26.50 rows=1 width=32) (never executed)

158.          

Initplan (for Result)

159. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=26.48..26.49 rows=1 width=32) (never executed)

160. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.91..1.92 rows=3 width=11) (never executed)

  • Sort Key: __local_88__.id
161. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests_test_results __local_88__ (cost=0.00..1.89 rows=3 width=11) (never executed)

  • Filter: (test_id = __local_82__.id)
162.          

SubPlan (for Aggregate)

163. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_87__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_88__.result)
164. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_89__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_80__.result_1_id)
165. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_90__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_80__.result_1_by_id)
166. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_91__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_80__.result_2_id)
167. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_92__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_80__.result_2_by_id)
168. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_93__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_80__.result_final_id)
169. 0.000 0.000 ↓ 0.0 0

Seq Scan on samples __local_94__ (cost=0.00..34.33 rows=1 width=32) (never executed)

  • Filter: (__local_80__.sample_id = id)
170.          

SubPlan (for Seq Scan)

171. 0.000 0.000 ↓ 0.0 0

Index Scan using tube_types_pkey on tube_types __local_95__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_94__.type_id)
172. 0.000 0.000 ↓ 0.0 0

Index Scan using tubes_pkey on tubes __local_96__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_94__.tube_id)
173.          

SubPlan (for Index Scan)

174. 0.000 0.000 ↓ 0.0 0

Index Scan using specimen_types_pkey on specimen_types __local_97__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_96__.specimen_type_id)
175. 0.000 0.000 ↓ 0.0 0

Index Scan using transfusion_pkey on transfusion __local_98__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_94__.transfusion_id)
176. 0.000 0.000 ↓ 0.0 0

Result (cost=366.46..366.47 rows=1 width=32) (never executed)

177.          

Initplan (for Result)

178. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=366.45..366.46 rows=1 width=32) (never executed)

179. 0.000 0.000 ↓ 0.0 0

Sort (cost=4.32..4.33 rows=3 width=91) (never executed)

  • Sort Key: __local_100__.id
180. 0.000 0.000 ↓ 0.0 0

Seq Scan on test_order_results __local_100__ (cost=0.00..4.30 rows=3 width=91) (never executed)

  • Filter: (parent_result_id = __local_80__.id)
181.          

SubPlan (for Aggregate)

182. 0.000 0.000 ↓ 0.0 0

Index Scan using test_result_sets_pkey on test_result_sets __local_101__ (cost=0.15..45.51 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_100__.test_result_set_id)
183.          

SubPlan (for Index Scan)

184. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_102__ (cost=0.00..37.34 rows=1 width=32) (never executed)

  • Filter: (__local_101__.test_id = id)
185.          

SubPlan (for Seq Scan)

186. 0.000 0.000 ↓ 0.0 0

Index Scan using labs_pkey on labs __local_103__ (cost=0.14..8.16 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_102__.reference_lab_id)
187. 0.000 0.000 ↓ 0.0 0

Result (cost=1.35..1.36 rows=1 width=32) (never executed)

188.          

Initplan (for Result)

189. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.34..1.35 rows=1 width=32) (never executed)

190. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.32..1.33 rows=1 width=314) (never executed)

  • Sort Key: __local_105__.id
191. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_105__ (cost=0.00..1.31 rows=1 width=314) (never executed)

  • Filter: (parent_id = __local_102__.id)
192. 0.000 0.000 ↓ 0.0 0

Result (cost=26.49..26.50 rows=1 width=32) (never executed)

193.          

Initplan (for Result)

194. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=26.48..26.49 rows=1 width=32) (never executed)

195. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.91..1.92 rows=3 width=11) (never executed)

  • Sort Key: __local_108__.id
196. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests_test_results __local_108__ (cost=0.00..1.89 rows=3 width=11) (never executed)

  • Filter: (test_id = __local_102__.id)
197.          

SubPlan (for Aggregate)

198. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_107__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_108__.result)
199. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_109__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_100__.result_1_id)
200. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_110__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_100__.result_1_by_id)
201. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_111__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_100__.result_2_id)
202. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_112__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_100__.result_2_by_id)
203. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_113__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_100__.result_final_id)
204. 0.000 0.000 ↓ 0.0 0

Seq Scan on samples __local_114__ (cost=0.00..34.33 rows=1 width=32) (never executed)

  • Filter: (__local_100__.sample_id = id)
205.          

SubPlan (for Seq Scan)

206. 0.000 0.000 ↓ 0.0 0

Index Scan using tube_types_pkey on tube_types __local_115__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_114__.type_id)
207. 0.000 0.000 ↓ 0.0 0

Index Scan using tubes_pkey on tubes __local_116__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_114__.tube_id)
208.          

SubPlan (for Index Scan)

209. 0.000 0.000 ↓ 0.0 0

Index Scan using specimen_types_pkey on specimen_types __local_117__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_116__.specimen_type_id)
210. 0.000 0.000 ↓ 0.0 0

Index Scan using transfusion_pkey on transfusion __local_118__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_114__.transfusion_id)
211. 2.198 2.198 ↓ 0.0 0 157

Seq Scan on test_orders __local_119__ (cost=0.00..1,231.73 rows=1 width=32) (actual time=0.013..0.014 rows=0 loops=157)

  • Filter: (__local_0__.original_order_id = id)
  • Rows Removed by Filter: 157
212.          

SubPlan (for Seq Scan)

213. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_120__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_119__.initial_result_value)
214. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_121__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_119__.final_result_value)
215. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_122__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_119__.entered_by_id)
216.          

SubPlan (for Index Scan)

217. 0.000 0.000 ↓ 0.0 0

Index Scan using orgs_pkey on orgs __local_123__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_122__.org_id)
218. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_124__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_119__.validated_by_id)
219.          

SubPlan (for Index Scan)

220. 0.000 0.000 ↓ 0.0 0

Index Scan using orgs_pkey on orgs __local_125__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_124__.org_id)
221. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_126__ (cost=0.00..37.34 rows=1 width=32) (never executed)

  • Filter: (__local_119__.test_id = id)
222.          

SubPlan (for Seq Scan)

223. 0.000 0.000 ↓ 0.0 0

Index Scan using labs_pkey on labs __local_127__ (cost=0.14..8.16 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_126__.reference_lab_id)
224. 0.000 0.000 ↓ 0.0 0

Result (cost=1.35..1.36 rows=1 width=32) (never executed)

225.          

Initplan (for Result)

226. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.34..1.35 rows=1 width=32) (never executed)

227. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.32..1.33 rows=1 width=314) (never executed)

  • Sort Key: __local_129__.id
228. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_129__ (cost=0.00..1.31 rows=1 width=314) (never executed)

  • Filter: (parent_id = __local_126__.id)
229. 0.000 0.000 ↓ 0.0 0

Result (cost=26.49..26.50 rows=1 width=32) (never executed)

230.          

Initplan (for Result)

231. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=26.48..26.49 rows=1 width=32) (never executed)

232. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.91..1.92 rows=3 width=11) (never executed)

  • Sort Key: __local_132__.id
233. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests_test_results __local_132__ (cost=0.00..1.89 rows=3 width=11) (never executed)

  • Filter: (test_id = __local_126__.id)
234.          

SubPlan (for Aggregate)

235. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_131__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_132__.result)
236. 0.000 0.000 ↓ 0.0 0

Seq Scan on samples __local_133__ (cost=0.00..34.33 rows=1 width=32) (never executed)

  • Filter: (__local_119__.sample_id = id)
237.          

SubPlan (for Seq Scan)

238. 0.000 0.000 ↓ 0.0 0

Index Scan using tube_types_pkey on tube_types __local_134__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_133__.type_id)
239. 0.000 0.000 ↓ 0.0 0

Index Scan using tubes_pkey on tubes __local_135__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_133__.tube_id)
240.          

SubPlan (for Index Scan)

241. 0.000 0.000 ↓ 0.0 0

Index Scan using specimen_types_pkey on specimen_types __local_136__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_135__.specimen_type_id)
242. 0.000 0.000 ↓ 0.0 0

Index Scan using transfusion_pkey on transfusion __local_137__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_133__.transfusion_id)
243. 0.000 0.000 ↓ 0.0 0

Result (cost=491.51..491.52 rows=1 width=32) (never executed)

244.          

Initplan (for Result)

245. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=491.50..491.51 rows=1 width=32) (never executed)

246. 0.000 0.000 ↓ 0.0 0

Sort (cost=4.31..4.32 rows=1 width=91) (never executed)

  • Sort Key: __local_139__.id
247. 0.000 0.000 ↓ 0.0 0

Seq Scan on test_order_results __local_139__ (cost=0.00..4.30 rows=1 width=91) (never executed)

  • Filter: (test_order_id = __local_119__.id)
248.          

SubPlan (for Aggregate)

249. 0.000 0.000 ↓ 0.0 0

Index Scan using test_result_sets_pkey on test_result_sets __local_140__ (cost=0.15..45.51 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_139__.test_result_set_id)
250.          

SubPlan (for Index Scan)

251. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_141__ (cost=0.00..37.34 rows=1 width=32) (never executed)

  • Filter: (__local_140__.test_id = id)
252.          

SubPlan (for Seq Scan)

253. 0.000 0.000 ↓ 0.0 0

Index Scan using labs_pkey on labs __local_142__ (cost=0.14..8.16 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_141__.reference_lab_id)
254. 0.000 0.000 ↓ 0.0 0

Result (cost=1.35..1.36 rows=1 width=32) (never executed)

255.          

Initplan (for Result)

256. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.34..1.35 rows=1 width=32) (never executed)

257. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.32..1.33 rows=1 width=314) (never executed)

  • Sort Key: __local_144__.id
258. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_144__ (cost=0.00..1.31 rows=1 width=314) (never executed)

  • Filter: (parent_id = __local_141__.id)
259. 0.000 0.000 ↓ 0.0 0

Result (cost=26.49..26.50 rows=1 width=32) (never executed)

260.          

Initplan (for Result)

261. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=26.48..26.49 rows=1 width=32) (never executed)

262. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.91..1.92 rows=3 width=11) (never executed)

  • Sort Key: __local_147__.id
263. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests_test_results __local_147__ (cost=0.00..1.89 rows=3 width=11) (never executed)

  • Filter: (test_id = __local_141__.id)
264.          

SubPlan (for Aggregate)

265. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_146__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_147__.result)
266. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_148__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_139__.result_1_id)
267. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_149__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_139__.result_1_by_id)
268. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_150__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_139__.result_2_id)
269. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_151__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_139__.result_2_by_id)
270. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_152__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_139__.result_final_id)
271. 0.000 0.000 ↓ 0.0 0

Seq Scan on samples __local_153__ (cost=0.00..34.33 rows=1 width=32) (never executed)

  • Filter: (__local_139__.sample_id = id)
272.          

SubPlan (for Seq Scan)

273. 0.000 0.000 ↓ 0.0 0

Index Scan using tube_types_pkey on tube_types __local_154__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_153__.type_id)
274. 0.000 0.000 ↓ 0.0 0

Index Scan using tubes_pkey on tubes __local_155__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_153__.tube_id)
275.          

SubPlan (for Index Scan)

276. 0.000 0.000 ↓ 0.0 0

Index Scan using specimen_types_pkey on specimen_types __local_156__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_155__.specimen_type_id)
277. 0.000 0.000 ↓ 0.0 0

Index Scan using transfusion_pkey on transfusion __local_157__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_153__.transfusion_id)
278. 0.000 0.000 ↓ 0.0 0

Result (cost=366.46..366.47 rows=1 width=32) (never executed)

279.          

Initplan (for Result)

280. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=366.45..366.46 rows=1 width=32) (never executed)

281. 0.000 0.000 ↓ 0.0 0

Sort (cost=4.32..4.33 rows=3 width=91) (never executed)

  • Sort Key: __local_159__.id
282. 0.000 0.000 ↓ 0.0 0

Seq Scan on test_order_results __local_159__ (cost=0.00..4.30 rows=3 width=91) (never executed)

  • Filter: (parent_result_id = __local_139__.id)
283.          

SubPlan (for Aggregate)

284. 0.000 0.000 ↓ 0.0 0

Index Scan using test_result_sets_pkey on test_result_sets __local_160__ (cost=0.15..45.51 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_159__.test_result_set_id)
285.          

SubPlan (for Index Scan)

286. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_161__ (cost=0.00..37.34 rows=1 width=32) (never executed)

  • Filter: (__local_160__.test_id = id)
287.          

SubPlan (for Seq Scan)

288. 0.000 0.000 ↓ 0.0 0

Index Scan using labs_pkey on labs __local_162__ (cost=0.14..8.16 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_161__.reference_lab_id)
289. 0.000 0.000 ↓ 0.0 0

Result (cost=1.35..1.36 rows=1 width=32) (never executed)

290.          

Initplan (for Result)

291. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.34..1.35 rows=1 width=32) (never executed)

292. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.32..1.33 rows=1 width=314) (never executed)

  • Sort Key: __local_164__.id
293. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_164__ (cost=0.00..1.31 rows=1 width=314) (never executed)

  • Filter: (parent_id = __local_161__.id)
294. 0.000 0.000 ↓ 0.0 0

Result (cost=26.49..26.50 rows=1 width=32) (never executed)

295.          

Initplan (for Result)

296. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=26.48..26.49 rows=1 width=32) (never executed)

297. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.91..1.92 rows=3 width=11) (never executed)

  • Sort Key: __local_167__.id
298. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests_test_results __local_167__ (cost=0.00..1.89 rows=3 width=11) (never executed)

  • Filter: (test_id = __local_161__.id)
299.          

SubPlan (for Aggregate)

300. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_166__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_167__.result)
301. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_168__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_159__.result_1_id)
302. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_169__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_159__.result_1_by_id)
303. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_170__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_159__.result_2_id)
304. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_171__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_159__.result_2_by_id)
305. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_172__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_159__.result_final_id)
306. 0.000 0.000 ↓ 0.0 0

Seq Scan on samples __local_173__ (cost=0.00..34.33 rows=1 width=32) (never executed)

  • Filter: (__local_159__.sample_id = id)
307.          

SubPlan (for Seq Scan)

308. 0.000 0.000 ↓ 0.0 0

Index Scan using tube_types_pkey on tube_types __local_174__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_173__.type_id)
309. 0.000 0.000 ↓ 0.0 0

Index Scan using tubes_pkey on tubes __local_175__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_173__.tube_id)
310.          

SubPlan (for Index Scan)

311. 0.000 0.000 ↓ 0.0 0

Index Scan using specimen_types_pkey on specimen_types __local_176__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_175__.specimen_type_id)
312. 0.000 0.000 ↓ 0.0 0

Index Scan using transfusion_pkey on transfusion __local_177__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_173__.transfusion_id)
313. 0.000 0.000 ↓ 0.0 0

Result (cost=615.88..615.89 rows=1 width=32) (never executed)

314.          

Initplan (for Result)

315. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=615.87..615.88 rows=1 width=32) (never executed)

316. 0.000 0.000 ↓ 0.0 0

Sort (cost=3.65..3.65 rows=1 width=93) (never executed)

  • Sort Key: __local_179__.id
317. 0.000 0.000 ↓ 0.0 0

Seq Scan on test_orders __local_179__ (cost=0.00..3.64 rows=1 width=93) (never executed)

  • Filter: (original_order_id = __local_119__.id)
318.          

SubPlan (for Aggregate)

319. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_180__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_179__.initial_result_value)
320. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_181__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_179__.final_result_value)
321. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_182__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_179__.entered_by_id)
322.          

SubPlan (for Index Scan)

323. 0.000 0.000 ↓ 0.0 0

Index Scan using orgs_pkey on orgs __local_183__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_182__.org_id)
324. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_184__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_179__.validated_by_id)
325.          

SubPlan (for Index Scan)

326. 0.000 0.000 ↓ 0.0 0

Index Scan using orgs_pkey on orgs __local_185__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_184__.org_id)
327. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_186__ (cost=0.00..37.34 rows=1 width=32) (never executed)

  • Filter: (__local_179__.test_id = id)
328.          

SubPlan (for Seq Scan)

329. 0.000 0.000 ↓ 0.0 0

Index Scan using labs_pkey on labs __local_187__ (cost=0.14..8.16 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_186__.reference_lab_id)
330. 0.000 0.000 ↓ 0.0 0

Result (cost=1.35..1.36 rows=1 width=32) (never executed)

331.          

Initplan (for Result)

332. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.34..1.35 rows=1 width=32) (never executed)

333. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.32..1.33 rows=1 width=314) (never executed)

  • Sort Key: __local_189__.id
334. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_189__ (cost=0.00..1.31 rows=1 width=314) (never executed)

  • Filter: (parent_id = __local_186__.id)
335. 0.000 0.000 ↓ 0.0 0

Result (cost=26.49..26.50 rows=1 width=32) (never executed)

336.          

Initplan (for Result)

337. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=26.48..26.49 rows=1 width=32) (never executed)

338. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.91..1.92 rows=3 width=11) (never executed)

  • Sort Key: __local_192__.id
339. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests_test_results __local_192__ (cost=0.00..1.89 rows=3 width=11) (never executed)

  • Filter: (test_id = __local_186__.id)
340.          

SubPlan (for Aggregate)

341. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_191__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_192__.result)
342. 0.000 0.000 ↓ 0.0 0

Seq Scan on samples __local_193__ (cost=0.00..34.33 rows=1 width=32) (never executed)

  • Filter: (__local_179__.sample_id = id)
343.          

SubPlan (for Seq Scan)

344. 0.000 0.000 ↓ 0.0 0

Index Scan using tube_types_pkey on tube_types __local_194__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_193__.type_id)
345. 0.000 0.000 ↓ 0.0 0

Index Scan using tubes_pkey on tubes __local_195__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_193__.tube_id)
346.          

SubPlan (for Index Scan)

347. 0.000 0.000 ↓ 0.0 0

Index Scan using specimen_types_pkey on specimen_types __local_196__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_195__.specimen_type_id)
348. 0.000 0.000 ↓ 0.0 0

Index Scan using transfusion_pkey on transfusion __local_197__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_193__.transfusion_id)
349. 0.000 0.000 ↓ 0.0 0

Result (cost=491.51..491.52 rows=1 width=32) (never executed)

350.          

Initplan (for Result)

351. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=491.50..491.51 rows=1 width=32) (never executed)

352. 0.000 0.000 ↓ 0.0 0

Sort (cost=4.31..4.32 rows=1 width=91) (never executed)

  • Sort Key: __local_199__.id
353. 0.000 0.000 ↓ 0.0 0

Seq Scan on test_order_results __local_199__ (cost=0.00..4.30 rows=1 width=91) (never executed)

  • Filter: (test_order_id = __local_179__.id)
354.          

SubPlan (for Aggregate)

355. 0.000 0.000 ↓ 0.0 0

Index Scan using test_result_sets_pkey on test_result_sets __local_200__ (cost=0.15..45.51 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_199__.test_result_set_id)
356.          

SubPlan (for Index Scan)

357. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_201__ (cost=0.00..37.34 rows=1 width=32) (never executed)

  • Filter: (__local_200__.test_id = id)
358.          

SubPlan (for Seq Scan)

359. 0.000 0.000 ↓ 0.0 0

Index Scan using labs_pkey on labs __local_202__ (cost=0.14..8.16 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_201__.reference_lab_id)
360. 0.000 0.000 ↓ 0.0 0

Result (cost=1.35..1.36 rows=1 width=32) (never executed)

361.          

Initplan (for Result)

362. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.34..1.35 rows=1 width=32) (never executed)

363. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.32..1.33 rows=1 width=314) (never executed)

  • Sort Key: __local_204__.id
364. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_204__ (cost=0.00..1.31 rows=1 width=314) (never executed)

  • Filter: (parent_id = __local_201__.id)
365. 0.000 0.000 ↓ 0.0 0

Result (cost=26.49..26.50 rows=1 width=32) (never executed)

366.          

Initplan (for Result)

367. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=26.48..26.49 rows=1 width=32) (never executed)

368. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.91..1.92 rows=3 width=11) (never executed)

  • Sort Key: __local_207__.id
369. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests_test_results __local_207__ (cost=0.00..1.89 rows=3 width=11) (never executed)

  • Filter: (test_id = __local_201__.id)
370.          

SubPlan (for Aggregate)

371. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_206__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_207__.result)
372. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_208__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_199__.result_1_id)
373. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_209__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_199__.result_1_by_id)
374. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_210__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_199__.result_2_id)
375. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_211__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_199__.result_2_by_id)
376. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_212__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_199__.result_final_id)
377. 0.000 0.000 ↓ 0.0 0

Seq Scan on samples __local_213__ (cost=0.00..34.33 rows=1 width=32) (never executed)

  • Filter: (__local_199__.sample_id = id)
378.          

SubPlan (for Seq Scan)

379. 0.000 0.000 ↓ 0.0 0

Index Scan using tube_types_pkey on tube_types __local_214__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_213__.type_id)
380. 0.000 0.000 ↓ 0.0 0

Index Scan using tubes_pkey on tubes __local_215__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_213__.tube_id)
381.          

SubPlan (for Index Scan)

382. 0.000 0.000 ↓ 0.0 0

Index Scan using specimen_types_pkey on specimen_types __local_216__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_215__.specimen_type_id)
383. 0.000 0.000 ↓ 0.0 0

Index Scan using transfusion_pkey on transfusion __local_217__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_213__.transfusion_id)
384. 0.000 0.000 ↓ 0.0 0

Result (cost=366.46..366.47 rows=1 width=32) (never executed)

385.          

Initplan (for Result)

386. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=366.45..366.46 rows=1 width=32) (never executed)

387. 0.000 0.000 ↓ 0.0 0

Sort (cost=4.32..4.33 rows=3 width=91) (never executed)

  • Sort Key: __local_219__.id
388. 0.000 0.000 ↓ 0.0 0

Seq Scan on test_order_results __local_219__ (cost=0.00..4.30 rows=3 width=91) (never executed)

  • Filter: (parent_result_id = __local_199__.id)
389.          

SubPlan (for Aggregate)

390. 0.000 0.000 ↓ 0.0 0

Index Scan using test_result_sets_pkey on test_result_sets __local_220__ (cost=0.15..45.51 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_219__.test_result_set_id)
391.          

SubPlan (for Index Scan)

392. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_221__ (cost=0.00..37.34 rows=1 width=32) (never executed)

  • Filter: (__local_220__.test_id = id)
393.          

SubPlan (for Seq Scan)

394. 0.000 0.000 ↓ 0.0 0

Index Scan using labs_pkey on labs __local_222__ (cost=0.14..8.16 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_221__.reference_lab_id)
395. 0.000 0.000 ↓ 0.0 0

Result (cost=1.35..1.36 rows=1 width=32) (never executed)

396.          

Initplan (for Result)

397. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.34..1.35 rows=1 width=32) (never executed)

398. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.32..1.33 rows=1 width=314) (never executed)

  • Sort Key: __local_224__.id
399. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests __local_224__ (cost=0.00..1.31 rows=1 width=314) (never executed)

  • Filter: (parent_id = __local_221__.id)
400. 0.000 0.000 ↓ 0.0 0

Result (cost=26.49..26.50 rows=1 width=32) (never executed)

401.          

Initplan (for Result)

402. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=26.48..26.49 rows=1 width=32) (never executed)

403. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.91..1.92 rows=3 width=11) (never executed)

  • Sort Key: __local_227__.id
404. 0.000 0.000 ↓ 0.0 0

Seq Scan on tests_test_results __local_227__ (cost=0.00..1.89 rows=3 width=11) (never executed)

  • Filter: (test_id = __local_221__.id)
405.          

SubPlan (for Aggregate)

406. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_226__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_227__.result)
407. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_228__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_219__.result_1_id)
408. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_229__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_219__.result_1_by_id)
409. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_230__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_219__.result_2_id)
410. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users __local_231__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_219__.result_2_by_id)
411. 0.000 0.000 ↓ 0.0 0

Index Scan using test_results_pkey on test_results __local_232__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_219__.result_final_id)
412. 0.000 0.000 ↓ 0.0 0

Seq Scan on samples __local_233__ (cost=0.00..34.33 rows=1 width=32) (never executed)

  • Filter: (__local_219__.sample_id = id)
413.          

SubPlan (for Seq Scan)

414. 0.000 0.000 ↓ 0.0 0

Index Scan using tube_types_pkey on tube_types __local_234__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_233__.type_id)
415. 0.000 0.000 ↓ 0.0 0

Index Scan using tubes_pkey on tubes __local_235__ (cost=0.15..16.34 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_233__.tube_id)
416.          

SubPlan (for Index Scan)

417. 0.000 0.000 ↓ 0.0 0

Index Scan using specimen_types_pkey on specimen_types __local_236__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_235__.specimen_type_id)
418. 0.000 0.000 ↓ 0.0 0

Index Scan using transfusion_pkey on transfusion __local_237__ (cost=0.15..8.17 rows=1 width=32) (never executed)

  • Index Cond: (value = __local_233__.transfusion_id)