explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZiiS

Settings
# exclusive inclusive rows x rows loops node
1. 1,399.591 1,432.743 ↑ 1.0 30 1

Limit (cost=0.25..239,143.30 rows=30 width=832) (actual time=1,401.438..1,432.743 rows=30 loops=1)

2. 2.222 33.152 ↑ 33.3 30 1

Function Scan on search_accessions __local_0__ (cost=0.25..7,971,435.29 rows=1,000 width=832) (actual time=1.873..33.152 rows=30 loops=1)

3.          

SubPlan (for Function Scan)

4. 0.030 0.660 ↑ 1.0 1 30

Result (cost=1.62..1.63 rows=1 width=32) (actual time=0.022..0.022 rows=1 loops=30)

5.          

Initplan (for Result)

6. 0.090 0.630 ↑ 1.0 1 30

Aggregate (cost=1.61..1.62 rows=1 width=32) (actual time=0.020..0.021 rows=1 loops=30)

7. 0.210 0.540 ↓ 0.0 0 30

Sort (cost=1.59..1.59 rows=1 width=245) (actual time=0.018..0.018 rows=0 loops=30)

  • Sort Key: __local_2__.id
  • Sort Method: quicksort Memory: 25kB
8. 0.330 0.330 ↓ 0.0 0 30

Seq Scan on accessions __local_2__ (cost=0.00..1.58 rows=1 width=245) (actual time=0.010..0.011 rows=0 loops=30)

  • Filter: (cloned_from_id = __local_0__.id)
  • Rows Removed by Filter: 46
9. 0.240 0.240 ↑ 1.0 1 30

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

  • Index Cond: (id = __local_0__.org_id)
10. 0.060 0.390 ↑ 1.0 1 30

Result (cost=96.81..96.82 rows=1 width=32) (actual time=0.013..0.013 rows=1 loops=30)

11.          

Initplan (for Result)

12. 0.040 0.330 ↑ 1.0 1 30

Aggregate (cost=96.80..96.81 rows=1 width=32) (actual time=0.011..0.011 rows=1 loops=30)

13. 0.180 0.270 ↓ 0.0 0 30

Sort (cost=14.95..14.98 rows=10 width=12) (actual time=0.009..0.009 rows=0 loops=30)

  • Sort Key: __local_5__.id
  • Sort Method: quicksort Memory: 25kB
14. 0.030 0.090 ↓ 0.0 0 30

Bitmap Heap Scan on accession_orgs __local_5__ (cost=4.23..14.79 rows=10 width=12) (actual time=0.003..0.003 rows=0 loops=30)

  • Recheck Cond: (accession_id = __local_0__.id)
  • Heap Blocks: exact=2
15. 0.060 0.060 ↓ 0.0 0 30

Bitmap Index Scan on accession_orgs_accession_id_idx (cost=0.00..4.23 rows=10 width=0) (actual time=0.002..0.002 rows=0 loops=30)

  • Index Cond: (accession_id = __local_0__.id)
16.          

SubPlan (for Aggregate)

17. 0.020 0.020 ↑ 1.0 1 2

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

  • Index Cond: (id = __local_5__.org_id)
18. 0.060 1.530 ↑ 1.0 1 30

Result (cost=74.92..74.93 rows=1 width=32) (actual time=0.050..0.051 rows=1 loops=30)

19.          

Initplan (for Result)

20. 0.426 1.470 ↑ 1.0 1 30

Aggregate (cost=74.91..74.92 rows=1 width=32) (actual time=0.049..0.049 rows=1 loops=30)

21. 0.180 0.330 ↑ 2.0 1 30

Sort (cost=9.51..9.52 rows=2 width=176) (actual time=0.011..0.011 rows=1 loops=30)

  • Sort Key: __local_8__.id
  • Sort Method: quicksort Memory: 25kB
22. 0.090 0.150 ↑ 2.0 1 30

Bitmap Heap Scan on samples __local_8__ (cost=4.16..9.50 rows=2 width=176) (actual time=0.004..0.005 rows=1 loops=30)

  • Recheck Cond: (accession_id = __local_0__.id)
  • Heap Blocks: exact=30
23. 0.060 0.060 ↑ 2.0 1 30

Bitmap Index Scan on samples_accession_id_idx (cost=0.00..4.16 rows=2 width=0) (actual time=0.002..0.002 rows=1 loops=30)

  • Index Cond: (accession_id = __local_0__.id)
24.          

SubPlan (for Aggregate)

25. 0.204 0.204 ↑ 1.0 1 34

Index Scan using tube_types_pkey on tube_types __local_9__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.005..0.006 rows=1 loops=34)

  • Index Cond: (value = __local_8__.type_id)
26. 0.204 0.374 ↑ 1.0 1 34

Index Scan using tubes_pkey on tubes __local_10__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.011..0.011 rows=1 loops=34)

  • Index Cond: (id = __local_8__.tube_id)
27.          

SubPlan (for Index Scan)

28. 0.170 0.170 ↑ 1.0 1 34

Index Scan using specimen_types_pkey on specimen_types __local_11__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.004..0.005 rows=1 loops=34)

  • Index Cond: (value = __local_10__.specimen_type_id)
29. 0.136 0.136 ↑ 1.0 1 34

Index Scan using transfusion_pkey on transfusion __local_12__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.003..0.004 rows=1 loops=34)

  • Index Cond: (value = __local_8__.transfusion_id)
30. 0.330 0.480 ↑ 1.0 1 30

Index Scan using users_pkey on users __local_13__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.015..0.016 rows=1 loops=30)

  • Index Cond: (id = __local_0__.created_by_id)
31.          

SubPlan (for Index Scan)

32. 0.150 0.150 ↑ 1.0 1 30

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

  • Index Cond: (id = __local_13__.org_id)
33. 0.122 0.210 ↑ 1.0 1 30

Index Scan using users_pkey on users __local_15__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=30)

  • Index Cond: (id = __local_0__.received_by_id)
34.          

SubPlan (for Index Scan)

35. 0.088 0.088 ↑ 1.0 1 22

Index Scan using orgs_pkey on orgs __local_16__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=22)

  • Index Cond: (id = __local_15__.org_id)
36. 0.081 0.960 ↓ 0.0 0 30

Seq Scan on panels __local_17__ (cost=0.00..564.59 rows=1 width=32) (actual time=0.032..0.032 rows=0 loops=30)

  • Filter: (__local_0__.panel_id = id)
  • Rows Removed by Filter: 5
37.          

SubPlan (for Seq Scan)

38. 0.005 0.879 ↑ 1.0 1 1

Result (cost=563.51..563.52 rows=1 width=32) (actual time=0.875..0.879 rows=1 loops=1)

39.          

Initplan (for Result)

40. 0.059 0.874 ↑ 1.0 1 1

Aggregate (cost=563.50..563.51 rows=1 width=32) (actual time=0.871..0.874 rows=1 loops=1)

41. 0.008 0.022 ↓ 1.2 13 1

Sort (cost=1.85..1.88 rows=11 width=12) (actual time=0.019..0.022 rows=13 loops=1)

  • Sort Key: __local_26__.id
  • Sort Method: quicksort Memory: 25kB
42. 0.014 0.014 ↓ 1.2 13 1

Seq Scan on panels_tests __local_26__ (cost=0.00..1.66 rows=11 width=12) (actual time=0.010..0.014 rows=13 loops=1)

  • Filter: (panel_id = __local_17__.id)
  • Rows Removed by Filter: 40
43.          

SubPlan (for Aggregate)

44. 0.182 0.793 ↑ 1.0 1 13

Index Scan using tests_pkey on tests __local_19__ (cost=0.14..51.04 rows=1 width=32) (actual time=0.061..0.061 rows=1 loops=13)

  • Index Cond: (id = __local_26__.test_id)
45.          

SubPlan (for Index Scan)

46. 0.013 0.013 ↓ 0.0 0 13

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

  • Index Cond: (id = __local_19__.reference_lab_id)
47. 0.013 0.104 ↑ 1.0 1 13

Result (cost=8.21..8.21 rows=1 width=32) (actual time=0.008..0.008 rows=1 loops=13)

48.          

Initplan (for Result)

49. 0.013 0.091 ↑ 1.0 1 13

Aggregate (cost=8.20..8.21 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=13)

50. 0.065 0.078 ↓ 0.0 0 13

Sort (cost=8.17..8.18 rows=1 width=314) (actual time=0.006..0.006 rows=0 loops=13)

  • Sort Key: __local_22__.id
  • Sort Method: quicksort Memory: 25kB
51. 0.013 0.013 ↓ 0.0 0 13

Index Scan using tests_parent_id_idx on tests __local_22__ (cost=0.14..8.16 rows=1 width=314) (actual time=0.001..0.001 rows=0 loops=13)

  • Index Cond: (parent_id = __local_19__.id)
52. 0.013 0.494 ↑ 1.0 1 13

Result (cost=26.49..26.50 rows=1 width=32) (actual time=0.038..0.038 rows=1 loops=13)

53.          

Initplan (for Result)

54. 0.102 0.481 ↑ 1.0 1 13

Aggregate (cost=26.48..26.49 rows=1 width=32) (actual time=0.037..0.037 rows=1 loops=13)

55. 0.052 0.169 ↑ 1.0 3 13

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

  • Sort Key: __local_25__.id
  • Sort Method: quicksort Memory: 25kB
56. 0.117 0.117 ↑ 1.0 3 13

Seq Scan on tests_test_results __local_25__ (cost=0.00..1.89 rows=3 width=11) (actual time=0.006..0.009 rows=3 loops=13)

  • Filter: (test_id = __local_19__.id)
  • Rows Removed by Filter: 68
57.          

SubPlan (for Aggregate)

58. 0.210 0.210 ↑ 1.0 1 42

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

  • Index Cond: (value = __local_25__.result)
59. 0.150 24.180 ↑ 1.0 1 30

Result (cost=6,921.52..6,921.53 rows=1 width=32) (actual time=0.802..0.806 rows=1 loops=30)

60.          

Initplan (for Result)

61. 2.310 24.030 ↑ 1.0 1 30

Aggregate (cost=6,921.51..6,921.52 rows=1 width=32) (actual time=0.797..0.801 rows=1 loops=30)

62. 0.390 0.930 ↑ 1.5 2 30

Sort (cost=28.15..28.16 rows=3 width=125) (actual time=0.030..0.031 rows=2 loops=30)

  • Sort Key: ((SubPlan 264)), __local_28__.id
  • Sort Method: quicksort Memory: 25kB
63. 0.408 0.540 ↑ 1.5 2 30

Seq Scan on test_orders __local_28__ (cost=0.00..28.12 rows=3 width=125) (actual time=0.009..0.018 rows=2 loops=30)

  • Filter: (accession_id = __local_0__.id)
  • Rows Removed by Filter: 129
64.          

SubPlan (for Seq Scan)

65. 0.132 0.132 ↑ 1.0 1 66

Index Scan using tests_pkey on tests (cost=0.14..8.16 rows=1 width=32) (actual time=0.001..0.002 rows=1 loops=66)

  • Index Cond: (id = __local_28__.test_id)
66.          

SubPlan (for Aggregate)

67. 0.132 0.132 ↓ 0.0 0 66

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

  • Index Cond: (value = __local_28__.initial_result_value)
68. 0.132 0.132 ↓ 0.0 0 66

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

  • Index Cond: (value = __local_28__.final_result_value)
69. 0.144 0.264 ↓ 0.0 0 66

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

  • Index Cond: (id = __local_28__.entered_by_id)
70.          

SubPlan (for Index Scan)

71. 0.120 0.120 ↑ 1.0 1 20

Index Scan using orgs_pkey on orgs __local_32__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.006..0.006 rows=1 loops=20)

  • Index Cond: (id = __local_31__.org_id)
72. 0.184 0.264 ↓ 0.0 0 66

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

  • Index Cond: (id = __local_28__.validated_by_id)
73.          

SubPlan (for Index Scan)

74. 0.080 0.080 ↑ 1.0 1 20

Index Scan using orgs_pkey on orgs __local_34__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=20)

  • Index Cond: (id = __local_33__.org_id)
75. 0.660 3.564 ↑ 1.0 1 66

Index Scan using tests_pkey on tests __local_35__ (cost=0.14..51.04 rows=1 width=32) (actual time=0.053..0.054 rows=1 loops=66)

  • Index Cond: (id = __local_28__.test_id)
76.          

SubPlan (for Index Scan)

77. 0.132 0.132 ↓ 0.0 0 66

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

  • Index Cond: (id = __local_35__.reference_lab_id)
78. 0.066 0.660 ↑ 1.0 1 66

Result (cost=8.21..8.21 rows=1 width=32) (actual time=0.009..0.010 rows=1 loops=66)

79.          

Initplan (for Result)

80. 0.132 0.594 ↑ 1.0 1 66

Aggregate (cost=8.20..8.21 rows=1 width=32) (actual time=0.008..0.009 rows=1 loops=66)

81. 0.330 0.462 ↓ 0.0 0 66

Sort (cost=8.17..8.18 rows=1 width=314) (actual time=0.007..0.007 rows=0 loops=66)

  • Sort Key: __local_38__.id
  • Sort Method: quicksort Memory: 25kB
82. 0.132 0.132 ↓ 0.0 0 66

Index Scan using tests_parent_id_idx on tests __local_38__ (cost=0.14..8.16 rows=1 width=314) (actual time=0.001..0.002 rows=0 loops=66)

  • Index Cond: (parent_id = __local_35__.id)
83. 0.066 2.112 ↑ 1.0 1 66

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

84.          

Initplan (for Result)

85. 0.532 2.046 ↑ 1.0 1 66

Aggregate (cost=26.48..26.49 rows=1 width=32) (actual time=0.031..0.031 rows=1 loops=66)

86. 0.330 0.858 ↑ 1.5 2 66

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

  • Sort Key: __local_41__.id
  • Sort Method: quicksort Memory: 25kB
87. 0.528 0.528 ↑ 1.5 2 66

Seq Scan on tests_test_results __local_41__ (cost=0.00..1.89 rows=3 width=11) (actual time=0.006..0.008 rows=2 loops=66)

  • Filter: (test_id = __local_35__.id)
  • Rows Removed by Filter: 69
88.          

SubPlan (for Aggregate)

89. 0.656 0.656 ↑ 1.0 1 164

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

  • Index Cond: (value = __local_41__.result)
90. 0.102 0.198 ↓ 0.0 0 66

Index Scan using samples_pkey on samples __local_42__ (cost=0.15..40.85 rows=1 width=32) (actual time=0.003..0.003 rows=0 loops=66)

  • Index Cond: (id = __local_28__.sample_id)
91.          

SubPlan (for Index Scan)

92. 0.028 0.028 ↑ 1.0 1 4

Index Scan using tube_types_pkey on tube_types __local_43__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=4)

  • Index Cond: (value = __local_42__.type_id)
93. 0.040 0.056 ↑ 1.0 1 4

Index Scan using tubes_pkey on tubes __local_44__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.013..0.014 rows=1 loops=4)

  • Index Cond: (id = __local_42__.tube_id)
94.          

SubPlan (for Index Scan)

95. 0.016 0.016 ↑ 1.0 1 4

Index Scan using specimen_types_pkey on specimen_types __local_45__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=4)

  • Index Cond: (value = __local_44__.specimen_type_id)
96. 0.012 0.012 ↑ 1.0 1 4

Index Scan using transfusion_pkey on transfusion __local_46__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=4)

  • Index Cond: (value = __local_42__.transfusion_id)
97. 0.198 13.464 ↑ 1.0 1 66

Result (cost=430.78..430.79 rows=1 width=32) (actual time=0.203..0.204 rows=1 loops=66)

98.          

Initplan (for Result)

99. 1.362 13.266 ↑ 1.0 1 66

Aggregate (cost=430.77..430.78 rows=1 width=32) (actual time=0.200..0.201 rows=1 loops=66)

100. 0.396 2.244 ↑ 1.0 1 66

Sort (cost=3.98..3.99 rows=1 width=91) (actual time=0.034..0.034 rows=1 loops=66)

  • Sort Key: __local_48__.id
  • Sort Method: quicksort Memory: 25kB
101. 1.848 1.848 ↑ 1.0 1 66

Seq Scan on test_order_results __local_48__ (cost=0.00..3.98 rows=1 width=91) (actual time=0.019..0.028 rows=1 loops=66)

  • Filter: ((NOT is_reflex) AND (test_order_id = __local_28__.id))
  • Rows Removed by Filter: 157
102.          

SubPlan (for Aggregate)

103. 0.483 4.140 ↑ 1.0 1 69

Index Scan using test_result_sets_pkey on test_result_sets __local_49__ (cost=0.15..59.21 rows=1 width=32) (actual time=0.060..0.060 rows=1 loops=69)

  • Index Cond: (id = __local_48__.test_result_set_id)
104.          

SubPlan (for Index Scan)

105. 0.759 3.657 ↑ 1.0 1 69

Index Scan using tests_pkey on tests __local_50__ (cost=0.14..51.04 rows=1 width=32) (actual time=0.053..0.053 rows=1 loops=69)

  • Index Cond: (id = __local_49__.test_id)
106.          

SubPlan (for Index Scan)

107. 0.069 0.069 ↓ 0.0 0 69

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

  • Index Cond: (id = __local_50__.reference_lab_id)
108. 0.069 0.690 ↑ 1.0 1 69

Result (cost=8.21..8.21 rows=1 width=32) (actual time=0.010..0.010 rows=1 loops=69)

109.          

Initplan (for Result)

110. 0.207 0.621 ↑ 1.0 1 69

Aggregate (cost=8.20..8.21 rows=1 width=32) (actual time=0.009..0.009 rows=1 loops=69)

111. 0.276 0.414 ↑ 1.0 1 69

Sort (cost=8.17..8.18 rows=1 width=314) (actual time=0.006..0.006 rows=1 loops=69)

  • Sort Key: __local_53__.id
  • Sort Method: quicksort Memory: 25kB
112. 0.138 0.138 ↑ 1.0 1 69

Index Scan using tests_parent_id_idx on tests __local_53__ (cost=0.14..8.16 rows=1 width=314) (actual time=0.001..0.002 rows=1 loops=69)

  • Index Cond: (parent_id = __local_50__.id)
113. 0.069 2.139 ↑ 1.0 1 69

Result (cost=26.49..26.50 rows=1 width=32) (actual time=0.031..0.031 rows=1 loops=69)

114.          

Initplan (for Result)

115. 0.408 2.070 ↑ 1.0 1 69

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

116. 0.345 0.897 ↑ 1.5 2 69

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

  • Sort Key: __local_56__.id
  • Sort Method: quicksort Memory: 25kB
117. 0.552 0.552 ↑ 1.5 2 69

Seq Scan on tests_test_results __local_56__ (cost=0.00..1.89 rows=3 width=11) (actual time=0.006..0.008 rows=2 loops=69)

  • Filter: (test_id = __local_50__.id)
  • Rows Removed by Filter: 69
118.          

SubPlan (for Aggregate)

119. 0.765 0.765 ↑ 1.0 1 153

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

  • Index Cond: (value = __local_56__.result)
120. 0.138 0.138 ↓ 0.0 0 69

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

  • Index Cond: (value = __local_48__.result_1_id)
121. 0.138 0.138 ↓ 0.0 0 69

Index Scan using users_pkey on users __local_58__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.002..0.002 rows=0 loops=69)

  • Index Cond: (id = __local_48__.result_1_by_id)
122. 0.138 0.138 ↓ 0.0 0 69

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

  • Index Cond: (value = __local_48__.result_2_id)
123. 0.000 0.000 ↓ 0.0 0 69

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

  • Index Cond: (id = __local_48__.result_2_by_id)
124. 0.138 0.138 ↓ 0.0 0 69

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

  • Index Cond: (value = __local_48__.result_final_id)
125. 0.087 0.207 ↓ 0.0 0 69

Index Scan using samples_pkey on samples __local_62__ (cost=0.15..40.85 rows=1 width=32) (actual time=0.003..0.003 rows=0 loops=69)

  • Index Cond: (id = __local_48__.sample_id)
126.          

SubPlan (for Index Scan)

127. 0.016 0.016 ↑ 1.0 1 4

Index Scan using tube_types_pkey on tube_types __local_63__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.003..0.004 rows=1 loops=4)

  • Index Cond: (value = __local_62__.type_id)
128. 0.048 0.092 ↑ 1.0 1 4

Index Scan using tubes_pkey on tubes __local_64__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.023..0.023 rows=1 loops=4)

  • Index Cond: (id = __local_62__.tube_id)
129.          

SubPlan (for Index Scan)

130. 0.044 0.044 ↑ 1.0 1 4

Index Scan using specimen_types_pkey on specimen_types __local_65__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.011..0.011 rows=1 loops=4)

  • Index Cond: (value = __local_64__.specimen_type_id)
131. 0.012 0.012 ↑ 1.0 1 4

Index Scan using transfusion_pkey on transfusion __local_66__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=4)

  • Index Cond: (value = __local_62__.transfusion_id)
132. 0.138 4.761 ↑ 1.0 1 69

Result (cost=285.85..285.86 rows=1 width=32) (actual time=0.069..0.069 rows=1 loops=69)

133.          

Initplan (for Result)

134. 0.618 4.623 ↑ 1.0 1 69

Aggregate (cost=285.84..285.85 rows=1 width=32) (actual time=0.066..0.067 rows=1 loops=69)

135. 0.414 2.277 ↓ 0.0 0 69

Sort (cost=3.98..3.99 rows=2 width=91) (actual time=0.033..0.033 rows=0 loops=69)

  • Sort Key: __local_68__.id
  • Sort Method: quicksort Memory: 25kB
136. 1.863 1.863 ↓ 0.0 0 69

Seq Scan on test_order_results __local_68__ (cost=0.00..3.98 rows=2 width=91) (actual time=0.027..0.027 rows=0 loops=69)

  • Filter: (parent_result_id = __local_48__.id)
  • Rows Removed by Filter: 158
137.          

SubPlan (for Aggregate)

138. 0.144 1.560 ↑ 1.0 1 24

Index Scan using test_result_sets_pkey on test_result_sets __local_69__ (cost=0.15..59.21 rows=1 width=32) (actual time=0.063..0.065 rows=1 loops=24)

  • Index Cond: (id = __local_68__.test_result_set_id)
139.          

SubPlan (for Index Scan)

140. 0.360 1.416 ↑ 1.0 1 24

Index Scan using tests_pkey on tests __local_70__ (cost=0.14..51.04 rows=1 width=32) (actual time=0.058..0.059 rows=1 loops=24)

  • Index Cond: (id = __local_69__.test_id)
141.          

SubPlan (for Index Scan)

142. 0.000 0.000 ↓ 0.0 0 24

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

  • Index Cond: (id = __local_70__.reference_lab_id)
143. 0.024 0.192 ↑ 1.0 1 24

Result (cost=8.21..8.21 rows=1 width=32) (actual time=0.007..0.008 rows=1 loops=24)

144.          

Initplan (for Result)

145. 0.048 0.168 ↑ 1.0 1 24

Aggregate (cost=8.20..8.21 rows=1 width=32) (actual time=0.006..0.007 rows=1 loops=24)

146. 0.072 0.120 ↓ 0.0 0 24

Sort (cost=8.17..8.18 rows=1 width=314) (actual time=0.004..0.005 rows=0 loops=24)

  • Sort Key: __local_73__.id
  • Sort Method: quicksort Memory: 25kB
147. 0.048 0.048 ↓ 0.0 0 24

Index Scan using tests_parent_id_idx on tests __local_73__ (cost=0.14..8.16 rows=1 width=314) (actual time=0.001..0.002 rows=0 loops=24)

  • Index Cond: (parent_id = __local_70__.id)
148. 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)

149.          

Initplan (for Result)

150. 0.224 0.840 ↑ 1.0 1 24

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

151. 0.120 0.288 ↑ 1.0 3 24

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

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

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

  • Filter: (test_id = __local_70__.id)
  • Rows Removed by Filter: 68
153.          

SubPlan (for Aggregate)

154. 0.328 0.328 ↑ 1.0 1 82

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

  • Index Cond: (value = __local_76__.result)
155. 0.048 0.048 ↑ 1.0 1 24

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

  • Index Cond: (value = __local_68__.result_1_id)
156. 0.000 0.000 ↓ 0.0 0 24

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

  • Index Cond: (id = __local_68__.result_1_by_id)
157. 0.048 0.048 ↑ 1.0 1 24

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

  • Index Cond: (value = __local_68__.result_2_id)
158. 0.000 0.000 ↓ 0.0 0 24

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

  • Index Cond: (id = __local_68__.result_2_by_id)
159. 0.072 0.072 ↑ 1.0 1 24

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

  • Index Cond: (value = __local_68__.result_final_id)
160. 0.000 0.000 ↓ 0.0 0 24

Index Scan using samples_pkey on samples __local_82__ (cost=0.15..40.85 rows=1 width=32) (actual time=0.000..0.000 rows=0 loops=24)

  • Index Cond: (id = __local_68__.sample_id)
161.          

SubPlan (for Index Scan)

162. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_82__.type_id)
163. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_82__.tube_id)
164.          

SubPlan (for Index Scan)

165. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_84__.specimen_type_id)
166. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_82__.transfusion_id)
167. 0.198 2.112 ↑ 1.0 1 66

Result (cost=575.37..575.38 rows=1 width=32) (actual time=0.031..0.032 rows=1 loops=66)

168.          

Initplan (for Result)

169. 0.132 1.914 ↑ 1.0 1 66

Aggregate (cost=575.36..575.37 rows=1 width=32) (actual time=0.028..0.029 rows=1 loops=66)

170. 0.462 1.782 ↓ 0.0 0 66

Sort (cost=3.65..3.65 rows=1 width=93) (actual time=0.027..0.027 rows=0 loops=66)

  • Sort Key: __local_88__.id
  • Sort Method: quicksort Memory: 25kB
171. 1.320 1.320 ↓ 0.0 0 66

Seq Scan on test_orders __local_88__ (cost=0.00..3.64 rows=1 width=93) (actual time=0.020..0.020 rows=0 loops=66)

  • Filter: (original_order_id = __local_28__.id)
  • Rows Removed by Filter: 131
172.          

SubPlan (for Aggregate)

173. 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_88__.initial_result_value)
174. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_88__.final_result_value)
175. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_88__.entered_by_id)
176.          

SubPlan (for Index Scan)

177. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_91__.org_id)
178. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_88__.validated_by_id)
179.          

SubPlan (for Index Scan)

180. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_93__.org_id)
181. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_pkey on tests __local_95__ (cost=0.14..51.04 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_88__.test_id)
182.          

SubPlan (for Index Scan)

183. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_95__.reference_lab_id)
184. 0.000 0.000 ↓ 0.0 0

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

185.          

Initplan (for Result)

186. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.20..8.21 rows=1 width=32) (never executed)

187. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.17..8.18 rows=1 width=314) (never executed)

  • Sort Key: __local_98__.id
188. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_parent_id_idx on tests __local_98__ (cost=0.14..8.16 rows=1 width=314) (never executed)

  • Index Cond: (parent_id = __local_95__.id)
189. 0.000 0.000 ↓ 0.0 0

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

190.          

Initplan (for Result)

191. 0.000 0.000 ↓ 0.0 0

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

192. 0.000 0.000 ↓ 0.0 0

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

  • Sort Key: __local_101__.id
193. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (test_id = __local_95__.id)
194.          

SubPlan (for Aggregate)

195. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_101__.result)
196. 0.000 0.000 ↓ 0.0 0

Index Scan using samples_pkey on samples __local_102__ (cost=0.15..40.85 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_88__.sample_id)
197.          

SubPlan (for Index Scan)

198. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_102__.type_id)
199. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_102__.tube_id)
200.          

SubPlan (for Index Scan)

201. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_104__.specimen_type_id)
202. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_102__.transfusion_id)
203. 0.000 0.000 ↓ 0.0 0

Result (cost=430.78..430.79 rows=1 width=32) (never executed)

204.          

Initplan (for Result)

205. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=430.77..430.78 rows=1 width=32) (never executed)

206. 0.000 0.000 ↓ 0.0 0

Sort (cost=3.98..3.99 rows=1 width=91) (never executed)

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

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

  • Filter: ((NOT is_reflex) AND (test_order_id = __local_88__.id))
208.          

SubPlan (for Aggregate)

209. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_108__.test_result_set_id)
210.          

SubPlan (for Index Scan)

211. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_pkey on tests __local_110__ (cost=0.14..51.04 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_109__.test_id)
212.          

SubPlan (for Index Scan)

213. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_110__.reference_lab_id)
214. 0.000 0.000 ↓ 0.0 0

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

215.          

Initplan (for Result)

216. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.20..8.21 rows=1 width=32) (never executed)

217. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.17..8.18 rows=1 width=314) (never executed)

  • Sort Key: __local_113__.id
218. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_parent_id_idx on tests __local_113__ (cost=0.14..8.16 rows=1 width=314) (never executed)

  • Index Cond: (parent_id = __local_110__.id)
219. 0.000 0.000 ↓ 0.0 0

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

220.          

Initplan (for Result)

221. 0.000 0.000 ↓ 0.0 0

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

222. 0.000 0.000 ↓ 0.0 0

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

  • Sort Key: __local_116__.id
223. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (test_id = __local_110__.id)
224.          

SubPlan (for Aggregate)

225. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_116__.result)
226. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_108__.result_1_id)
227. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_108__.result_1_by_id)
228. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_108__.result_2_id)
229. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_108__.result_2_by_id)
230. 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_108__.result_final_id)
231. 0.000 0.000 ↓ 0.0 0

Index Scan using samples_pkey on samples __local_122__ (cost=0.15..40.85 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_108__.sample_id)
232.          

SubPlan (for Index Scan)

233. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_122__.type_id)
234. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_122__.tube_id)
235.          

SubPlan (for Index Scan)

236. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_124__.specimen_type_id)
237. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_122__.transfusion_id)
238. 0.000 0.000 ↓ 0.0 0

Result (cost=285.85..285.86 rows=1 width=32) (never executed)

239.          

Initplan (for Result)

240. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=285.84..285.85 rows=1 width=32) (never executed)

241. 0.000 0.000 ↓ 0.0 0

Sort (cost=3.98..3.99 rows=2 width=91) (never executed)

  • Sort Key: __local_128__.id
242. 0.000 0.000 ↓ 0.0 0

Seq Scan on test_order_results __local_128__ (cost=0.00..3.98 rows=2 width=91) (never executed)

  • Filter: (parent_result_id = __local_108__.id)
243.          

SubPlan (for Aggregate)

244. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_128__.test_result_set_id)
245.          

SubPlan (for Index Scan)

246. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_pkey on tests __local_130__ (cost=0.14..51.04 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_129__.test_id)
247.          

SubPlan (for Index Scan)

248. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_130__.reference_lab_id)
249. 0.000 0.000 ↓ 0.0 0

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

250.          

Initplan (for Result)

251. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.20..8.21 rows=1 width=32) (never executed)

252. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.17..8.18 rows=1 width=314) (never executed)

  • Sort Key: __local_133__.id
253. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_parent_id_idx on tests __local_133__ (cost=0.14..8.16 rows=1 width=314) (never executed)

  • Index Cond: (parent_id = __local_130__.id)
254. 0.000 0.000 ↓ 0.0 0

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

255.          

Initplan (for Result)

256. 0.000 0.000 ↓ 0.0 0

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

257. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Filter: (test_id = __local_130__.id)
259.          

SubPlan (for Aggregate)

260. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_136__.result)
261. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_128__.result_1_id)
262. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_128__.result_1_by_id)
263. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_128__.result_2_id)
264. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_128__.result_2_by_id)
265. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_128__.result_final_id)
266. 0.000 0.000 ↓ 0.0 0

Index Scan using samples_pkey on samples __local_142__ (cost=0.15..40.85 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_128__.sample_id)
267.          

SubPlan (for Index Scan)

268. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_142__.type_id)
269. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_142__.tube_id)
270.          

SubPlan (for Index Scan)

271. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_144__.specimen_type_id)
272. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_142__.transfusion_id)
273. 0.660 0.660 ↓ 0.0 0 66

Seq Scan on test_orders __local_147__ (cost=0.00..1,150.71 rows=1 width=32) (actual time=0.010..0.010 rows=0 loops=66)

  • Filter: (__local_28__.original_order_id = id)
  • Rows Removed by Filter: 131
274.          

SubPlan (for Seq Scan)

275. 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_147__.initial_result_value)
276. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_147__.final_result_value)
277. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_147__.entered_by_id)
278.          

SubPlan (for Index Scan)

279. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_150__.org_id)
280. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_147__.validated_by_id)
281.          

SubPlan (for Index Scan)

282. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_152__.org_id)
283. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_pkey on tests __local_154__ (cost=0.14..51.04 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_147__.test_id)
284.          

SubPlan (for Index Scan)

285. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_154__.reference_lab_id)
286. 0.000 0.000 ↓ 0.0 0

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

287.          

Initplan (for Result)

288. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.20..8.21 rows=1 width=32) (never executed)

289. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.17..8.18 rows=1 width=314) (never executed)

  • Sort Key: __local_157__.id
290. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_parent_id_idx on tests __local_157__ (cost=0.14..8.16 rows=1 width=314) (never executed)

  • Index Cond: (parent_id = __local_154__.id)
291. 0.000 0.000 ↓ 0.0 0

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

292.          

Initplan (for Result)

293. 0.000 0.000 ↓ 0.0 0

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

294. 0.000 0.000 ↓ 0.0 0

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

  • Sort Key: __local_160__.id
295. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (test_id = __local_154__.id)
296.          

SubPlan (for Aggregate)

297. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_160__.result)
298. 0.000 0.000 ↓ 0.0 0

Index Scan using samples_pkey on samples __local_161__ (cost=0.15..40.85 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_147__.sample_id)
299.          

SubPlan (for Index Scan)

300. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_161__.type_id)
301. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_161__.tube_id)
302.          

SubPlan (for Index Scan)

303. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_163__.specimen_type_id)
304. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_161__.transfusion_id)
305. 0.000 0.000 ↓ 0.0 0

Result (cost=430.78..430.79 rows=1 width=32) (never executed)

306.          

Initplan (for Result)

307. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=430.77..430.78 rows=1 width=32) (never executed)

308. 0.000 0.000 ↓ 0.0 0

Sort (cost=3.98..3.99 rows=1 width=91) (never executed)

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

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

  • Filter: ((NOT is_reflex) AND (test_order_id = __local_147__.id))
310.          

SubPlan (for Aggregate)

311. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_167__.test_result_set_id)
312.          

SubPlan (for Index Scan)

313. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_pkey on tests __local_169__ (cost=0.14..51.04 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_168__.test_id)
314.          

SubPlan (for Index Scan)

315. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_169__.reference_lab_id)
316. 0.000 0.000 ↓ 0.0 0

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

317.          

Initplan (for Result)

318. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.20..8.21 rows=1 width=32) (never executed)

319. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.17..8.18 rows=1 width=314) (never executed)

  • Sort Key: __local_172__.id
320. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_parent_id_idx on tests __local_172__ (cost=0.14..8.16 rows=1 width=314) (never executed)

  • Index Cond: (parent_id = __local_169__.id)
321. 0.000 0.000 ↓ 0.0 0

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

322.          

Initplan (for Result)

323. 0.000 0.000 ↓ 0.0 0

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

324. 0.000 0.000 ↓ 0.0 0

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

  • Sort Key: __local_175__.id
325. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (test_id = __local_169__.id)
326.          

SubPlan (for Aggregate)

327. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_175__.result)
328. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_167__.result_1_id)
329. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_167__.result_1_by_id)
330. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_167__.result_2_id)
331. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_167__.result_2_by_id)
332. 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_167__.result_final_id)
333. 0.000 0.000 ↓ 0.0 0

Index Scan using samples_pkey on samples __local_181__ (cost=0.15..40.85 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_167__.sample_id)
334.          

SubPlan (for Index Scan)

335. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_181__.type_id)
336. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_181__.tube_id)
337.          

SubPlan (for Index Scan)

338. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_183__.specimen_type_id)
339. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_181__.transfusion_id)
340. 0.000 0.000 ↓ 0.0 0

Result (cost=285.85..285.86 rows=1 width=32) (never executed)

341.          

Initplan (for Result)

342. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=285.84..285.85 rows=1 width=32) (never executed)

343. 0.000 0.000 ↓ 0.0 0

Sort (cost=3.98..3.99 rows=2 width=91) (never executed)

  • Sort Key: __local_187__.id
344. 0.000 0.000 ↓ 0.0 0

Seq Scan on test_order_results __local_187__ (cost=0.00..3.98 rows=2 width=91) (never executed)

  • Filter: (parent_result_id = __local_167__.id)
345.          

SubPlan (for Aggregate)

346. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_187__.test_result_set_id)
347.          

SubPlan (for Index Scan)

348. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_pkey on tests __local_189__ (cost=0.14..51.04 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_188__.test_id)
349.          

SubPlan (for Index Scan)

350. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_189__.reference_lab_id)
351. 0.000 0.000 ↓ 0.0 0

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

352.          

Initplan (for Result)

353. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.20..8.21 rows=1 width=32) (never executed)

354. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.17..8.18 rows=1 width=314) (never executed)

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

Index Scan using tests_parent_id_idx on tests __local_192__ (cost=0.14..8.16 rows=1 width=314) (never executed)

  • Index Cond: (parent_id = __local_189__.id)
356. 0.000 0.000 ↓ 0.0 0

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

357.          

Initplan (for Result)

358. 0.000 0.000 ↓ 0.0 0

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

359. 0.000 0.000 ↓ 0.0 0

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

  • Sort Key: __local_195__.id
360. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (test_id = __local_189__.id)
361.          

SubPlan (for Aggregate)

362. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_195__.result)
363. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_187__.result_1_id)
364. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_187__.result_1_by_id)
365. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_187__.result_2_id)
366. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_187__.result_2_by_id)
367. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_187__.result_final_id)
368. 0.000 0.000 ↓ 0.0 0

Index Scan using samples_pkey on samples __local_201__ (cost=0.15..40.85 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_187__.sample_id)
369.          

SubPlan (for Index Scan)

370. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_201__.type_id)
371. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_201__.tube_id)
372.          

SubPlan (for Index Scan)

373. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_203__.specimen_type_id)
374. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_201__.transfusion_id)
375. 0.000 0.000 ↓ 0.0 0

Result (cost=575.37..575.38 rows=1 width=32) (never executed)

376.          

Initplan (for Result)

377. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=575.36..575.37 rows=1 width=32) (never executed)

378. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Filter: (original_order_id = __local_147__.id)
380.          

SubPlan (for Aggregate)

381. 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_207__.initial_result_value)
382. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_207__.final_result_value)
383. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_207__.entered_by_id)
384.          

SubPlan (for Index Scan)

385. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_210__.org_id)
386. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_207__.validated_by_id)
387.          

SubPlan (for Index Scan)

388. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_212__.org_id)
389. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_pkey on tests __local_214__ (cost=0.14..51.04 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_207__.test_id)
390.          

SubPlan (for Index Scan)

391. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_214__.reference_lab_id)
392. 0.000 0.000 ↓ 0.0 0

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

393.          

Initplan (for Result)

394. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.20..8.21 rows=1 width=32) (never executed)

395. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.17..8.18 rows=1 width=314) (never executed)

  • Sort Key: __local_217__.id
396. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_parent_id_idx on tests __local_217__ (cost=0.14..8.16 rows=1 width=314) (never executed)

  • Index Cond: (parent_id = __local_214__.id)
397. 0.000 0.000 ↓ 0.0 0

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

398.          

Initplan (for Result)

399. 0.000 0.000 ↓ 0.0 0

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

400. 0.000 0.000 ↓ 0.0 0

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

  • Sort Key: __local_220__.id
401. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (test_id = __local_214__.id)
402.          

SubPlan (for Aggregate)

403. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_220__.result)
404. 0.000 0.000 ↓ 0.0 0

Index Scan using samples_pkey on samples __local_221__ (cost=0.15..40.85 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_207__.sample_id)
405.          

SubPlan (for Index Scan)

406. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_221__.type_id)
407. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_221__.tube_id)
408.          

SubPlan (for Index Scan)

409. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_223__.specimen_type_id)
410. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_221__.transfusion_id)
411. 0.000 0.000 ↓ 0.0 0

Result (cost=430.78..430.79 rows=1 width=32) (never executed)

412.          

Initplan (for Result)

413. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=430.77..430.78 rows=1 width=32) (never executed)

414. 0.000 0.000 ↓ 0.0 0

Sort (cost=3.98..3.99 rows=1 width=91) (never executed)

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

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

  • Filter: ((NOT is_reflex) AND (test_order_id = __local_207__.id))
416.          

SubPlan (for Aggregate)

417. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_227__.test_result_set_id)
418.          

SubPlan (for Index Scan)

419. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_pkey on tests __local_229__ (cost=0.14..51.04 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_228__.test_id)
420.          

SubPlan (for Index Scan)

421. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_229__.reference_lab_id)
422. 0.000 0.000 ↓ 0.0 0

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

423.          

Initplan (for Result)

424. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.20..8.21 rows=1 width=32) (never executed)

425. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.17..8.18 rows=1 width=314) (never executed)

  • Sort Key: __local_232__.id
426. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_parent_id_idx on tests __local_232__ (cost=0.14..8.16 rows=1 width=314) (never executed)

  • Index Cond: (parent_id = __local_229__.id)
427. 0.000 0.000 ↓ 0.0 0

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

428.          

Initplan (for Result)

429. 0.000 0.000 ↓ 0.0 0

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

430. 0.000 0.000 ↓ 0.0 0

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

  • Sort Key: __local_235__.id
431. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (test_id = __local_229__.id)
432.          

SubPlan (for Aggregate)

433. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_235__.result)
434. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_227__.result_1_id)
435. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_227__.result_1_by_id)
436. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_227__.result_2_id)
437. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_227__.result_2_by_id)
438. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_227__.result_final_id)
439. 0.000 0.000 ↓ 0.0 0

Index Scan using samples_pkey on samples __local_241__ (cost=0.15..40.85 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_227__.sample_id)
440.          

SubPlan (for Index Scan)

441. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_241__.type_id)
442. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_241__.tube_id)
443.          

SubPlan (for Index Scan)

444. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_243__.specimen_type_id)
445. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_241__.transfusion_id)
446. 0.000 0.000 ↓ 0.0 0

Result (cost=285.85..285.86 rows=1 width=32) (never executed)

447.          

Initplan (for Result)

448. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=285.84..285.85 rows=1 width=32) (never executed)

449. 0.000 0.000 ↓ 0.0 0

Sort (cost=3.98..3.99 rows=2 width=91) (never executed)

  • Sort Key: __local_247__.id
450. 0.000 0.000 ↓ 0.0 0

Seq Scan on test_order_results __local_247__ (cost=0.00..3.98 rows=2 width=91) (never executed)

  • Filter: (parent_result_id = __local_227__.id)
451.          

SubPlan (for Aggregate)

452. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_247__.test_result_set_id)
453.          

SubPlan (for Index Scan)

454. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_pkey on tests __local_249__ (cost=0.14..51.04 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_248__.test_id)
455.          

SubPlan (for Index Scan)

456. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_249__.reference_lab_id)
457. 0.000 0.000 ↓ 0.0 0

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

458.          

Initplan (for Result)

459. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.20..8.21 rows=1 width=32) (never executed)

460. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.17..8.18 rows=1 width=314) (never executed)

  • Sort Key: __local_252__.id
461. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_parent_id_idx on tests __local_252__ (cost=0.14..8.16 rows=1 width=314) (never executed)

  • Index Cond: (parent_id = __local_249__.id)
462. 0.000 0.000 ↓ 0.0 0

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

463.          

Initplan (for Result)

464. 0.000 0.000 ↓ 0.0 0

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

465. 0.000 0.000 ↓ 0.0 0

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

  • Sort Key: __local_255__.id
466. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (test_id = __local_249__.id)
467.          

SubPlan (for Aggregate)

468. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_255__.result)
469. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_247__.result_1_id)
470. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_247__.result_1_by_id)
471. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_247__.result_2_id)
472. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_247__.result_2_by_id)
473. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_247__.result_final_id)
474. 0.000 0.000 ↓ 0.0 0

Index Scan using samples_pkey on samples __local_261__ (cost=0.15..40.85 rows=1 width=32) (never executed)

  • Index Cond: (id = __local_247__.sample_id)
475.          

SubPlan (for Index Scan)

476. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_261__.type_id)
477. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = __local_261__.tube_id)
478.          

SubPlan (for Index Scan)

479. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_263__.specimen_type_id)
480. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (value = __local_261__.transfusion_id)
481. 0.030 1.350 ↑ 1.0 1 30

Result (cost=67.11..67.12 rows=1 width=32) (actual time=0.045..0.045 rows=1 loops=30)

482.          

Initplan (for Result)

483. 0.318 1.320 ↑ 1.0 1 30

Aggregate (cost=67.10..67.11 rows=1 width=32) (actual time=0.044..0.044 rows=1 loops=30)

484. 0.300 0.540 ↑ 4.0 1 30

Sort (cost=1.69..1.70 rows=4 width=65) (actual time=0.018..0.018 rows=1 loops=30)

  • Sort Key: __local_267__.created_at DESC, __local_267__.id
  • Sort Method: quicksort Memory: 26kB
485. 0.240 0.240 ↑ 4.0 1 30

Seq Scan on reports __local_267__ (cost=0.00..1.65 rows=4 width=65) (actual time=0.007..0.008 rows=1 loops=30)

  • Filter: (accession_id = __local_0__.id)
  • Rows Removed by Filter: 51
486.          

SubPlan (for Aggregate)

487. 0.252 0.462 ↑ 1.0 1 42

Index Scan using users_pkey on users __local_268__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.011..0.011 rows=1 loops=42)

  • Index Cond: (id = __local_267__.created_by_id)
488.          

SubPlan (for Index Scan)

489. 0.210 0.210 ↑ 1.0 1 42

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

  • Index Cond: (id = __local_268__.org_id)
490. 0.060 0.540 ↑ 1.0 1 30

Result (cost=109.38..109.39 rows=1 width=32) (actual time=0.018..0.018 rows=1 loops=30)

491.          

Initplan (for Result)

492. 0.060 0.480 ↑ 1.0 1 30

Aggregate (cost=109.37..109.38 rows=1 width=32) (actual time=0.016..0.016 rows=1 loops=30)

493. 0.180 0.330 ↓ 0.0 0 30

Sort (cost=11.31..11.31 rows=3 width=101) (actual time=0.011..0.011 rows=0 loops=30)

  • Sort Key: __local_271__.id
  • Sort Method: quicksort Memory: 25kB
494. 0.090 0.150 ↓ 0.0 0 30

Bitmap Heap Scan on holds __local_271__ (cost=4.17..11.28 rows=3 width=101) (actual time=0.005..0.005 rows=0 loops=30)

  • Recheck Cond: (accession_id = __local_0__.id)
  • Heap Blocks: exact=2
495. 0.060 0.060 ↓ 0.0 0 30

Bitmap Index Scan on holds_accession_id_idx (cost=0.00..4.17 rows=3 width=0) (actual time=0.002..0.002 rows=0 loops=30)

  • Index Cond: (accession_id = __local_0__.id)
496.          

SubPlan (for Aggregate)

497. 0.022 0.052 ↑ 1.0 1 2

Index Scan using users_pkey on users __local_272__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.026..0.026 rows=1 loops=2)

  • Index Cond: (id = __local_271__.created_by_id)
498.          

SubPlan (for Index Scan)

499. 0.030 0.030 ↑ 1.0 1 2

Index Scan using orgs_pkey on orgs __local_273__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.015..0.015 rows=1 loops=2)

  • Index Cond: (id = __local_272__.org_id)
500. 0.018 0.038 ↑ 1.0 1 2

Index Scan using users_pkey on users __local_274__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.019..0.019 rows=1 loops=2)

  • Index Cond: (id = __local_271__.resolved_by_id)
501.          

SubPlan (for Index Scan)

502. 0.020 0.020 ↑ 1.0 1 2

Index Scan using orgs_pkey on orgs __local_275__ (cost=0.15..8.17 rows=1 width=32) (actual time=0.010..0.010 rows=1 loops=2)

  • Index Cond: (id = __local_274__.org_id)
503. 0.030 0.390 ↑ 1.0 1 30

Result (cost=94.49..94.50 rows=1 width=32) (actual time=0.013..0.013 rows=1 loops=30)

504.          

Initplan (for Result)

505. 0.071 0.360 ↑ 1.0 1 30

Aggregate (cost=94.48..94.49 rows=1 width=32) (actual time=0.012..0.012 rows=1 loops=30)

506. 0.150 0.270 ↓ 0.0 0 30

Sort (cost=12.72..12.73 rows=5 width=52) (actual time=0.009..0.009 rows=0 loops=30)

  • Sort Key: __local_277__.created_at, __local_277__.id
  • Sort Method: quicksort Memory: 25kB
507. 0.030 0.120 ↓ 0.0 0 30

Bitmap Heap Scan on accession_comments __local_277__ (cost=4.19..12.66 rows=5 width=52) (actual time=0.004..0.004 rows=0 loops=30)

  • Recheck Cond: (accession_id = __local_0__.id)
  • Heap Blocks: exact=1
508. 0.090 0.090 ↓ 0.0 0 30

Bitmap Index Scan on accession_comments_accession_id_idx (cost=0.00..4.19 rows=5 width=0) (actual time=0.003..0.003 rows=0 loops=30)

  • Index Cond: (accession_id = __local_0__.id)
509.          

SubPlan (for Aggregate)

510. 0.011 0.019 ↑ 1.0 1 1

Index Scan using users_pkey on users __local_278__ (cost=0.15..16.34 rows=1 width=32) (actual time=0.019..0.019 rows=1 loops=1)

  • Index Cond: (id = __local_277__.created_by_id)
511.          

SubPlan (for Index Scan)

512. 0.008 0.008 ↑ 1.0 1 1

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

  • Index Cond: (id = __local_278__.org_id)