explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aXIy

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop (cost=258,967.61..325,966.60 rows=44 width=677) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Hash Join (cost=258,967.33..325,951.93 rows=44 width=648) (actual rows= loops=)

  • Hash Cond: (c.volume_unit_id = u.id)
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=258,966.19..325,950.60 rows=44 width=546) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=258,965.77..325,579.63 rows=44 width=523) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Seq Scan on establishments e (cost=0.00..2.81 rows=1 width=21) (actual rows= loops=)

  • Filter: ((id = 53) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 5 or hashed SubPlan 6)))
6.          

SubPlan (for Seq Scan)

7. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (e.id = (current_setting('bartrack.currentestablishment'::text))::integer)
8. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_4 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('establishments#select'::text ~* (('^'::text || permission) || '$'::text))
9. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_5 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('establishments#select'::text ~* (('^'::text || permission) || '$'::text))
10. 0.000 0.000 ↓ 0.0

Hash Join (cost=258,965.77..325,576.38 rows=44 width=506) (actual rows= loops=)

  • Hash Cond: (i.container_id = c.id)
11. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=258,946.93..325,557.36 rows=71 width=478) (actual rows= loops=)

  • Hash Cond: (i.updated_by = us.id)
12. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=258,943.70..325,553.90 rows=71 width=464) (actual rows= loops=)

  • Merge Cond: (i.id = i_3.id)
13. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=129,618.76..196,228.75 rows=71 width=456) (actual rows= loops=)

  • Merge Cond: (i.id = ie_1.item_id)
14. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=129,618.48..174,283.34 rows=71 width=416) (actual rows= loops=)

  • Merge Cond: (i.id = i_2.id)
15. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=129,616.95..129,618.43 rows=71 width=376) (actual rows= loops=)

  • Merge Cond: (i.id = i_1.id)
16. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=292.01..293.24 rows=71 width=308) (actual rows= loops=)

  • Merge Cond: (i.id = item_lines.item_id)
17. 0.000 0.000 ↓ 0.0

Sort (cost=50.74..50.92 rows=71 width=300) (actual rows= loops=)

  • Sort Key: i.id
18. 0.000 0.000 ↓ 0.0

Seq Scan on items i (cost=0.00..48.56 rows=71 width=300) (actual rows= loops=)

  • Filter: ((establishment_id = 53) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 1 or hashed SubPlan 2)))
19.          

SubPlan (for Seq Scan)

20. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (i.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
21. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
22. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_1 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
23. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=241.27..241.76 rows=28 width=12) (actual rows= loops=)

  • Group Key: item_lines.item_id
24. 0.000 0.000 ↓ 0.0

Sort (cost=241.27..241.34 rows=29 width=4) (actual rows= loops=)

  • Sort Key: item_lines.item_id
25. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on item_lines (cost=34.00..240.56 rows=29 width=4) (actual rows= loops=)

  • Recheck Cond: ((queue_index >= '0'::double precision) AND (queue_index > '0'::real))
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 15 or hashed SubPlan 20))
26. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=34.00..34.00 rows=12 width=0) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on item_lines_itemqueuedonlyonceperline (cost=0.00..8.79 rows=129 width=0) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on item_lines_uniquequeueindexperline (cost=0.00..24.95 rows=57 width=0) (actual rows= loops=)

  • Index Cond: (queue_index > '0'::real)
29.          

SubPlan (for Bitmap Heap Scan)

30. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..16.61 rows=1 width=0) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..16.57 rows=1 width=0) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Index Scan using lines_pkey on lines l (cost=0.14..8.21 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = item_lines.line_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 11 or hashed SubPlan 12)))
33.          

SubPlan (for Index Scan)

34. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
35. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_10 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
36. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_11 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
37. 0.000 0.000 ↓ 0.0

Index Scan using items_pkey on items i_4 (cost=0.28..8.35 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = item_lines.item_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 13 or hashed SubPlan 14)))
38.          

SubPlan (for Index Scan)

39. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (i_4.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
40. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_12 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
41. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_13 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
42. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_14 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('item_lines#select'::text ~* (('^'::text || permission) || '$'::text))
43. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..71.77 rows=639 width=8) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Seq Scan on items i_5 (cost=0.00..53.72 rows=71 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 18 or hashed SubPlan 19)))
45.          

SubPlan (for Seq Scan)

46. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (i_5.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
47. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_17 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
48. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_18 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
49. 0.000 0.000 ↓ 0.0

Materialize (cost=0.01..10.09 rows=9 width=4) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..10.04 rows=9 width=4) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_19 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('item_lines#select'::text ~* (('^'::text || permission) || '$'::text))
52. 0.000 0.000 ↓ 0.0

Seq Scan on lines l_1 (cost=0.00..9.93 rows=9 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 16 or hashed SubPlan 17)))
53.          

SubPlan (for Seq Scan)

54. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_1.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
55. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_15 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
56. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_16 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
57. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=129,324.94..129,324.99 rows=1 width=72) (actual rows= loops=)

  • Group Key: i_1.id
58. 0.000 0.000 ↓ 0.0

Sort (cost=129,324.94..129,324.95 rows=1 width=44) (actual rows= loops=)

  • Sort Key: i_1.id
59. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=4,858.91..129,324.93 rows=1 width=44) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,858.63..129,324.33 rows=1 width=44) (actual rows= loops=)

  • Join Filter: (il.connected @> p_1.poured_at)
61. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=4,858.36..129,189.86 rows=1 width=44) (actual rows= loops=)

  • Join Filter: (lt.connected @> p_1.poured_at)
62. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,858.21..129,173.56 rows=1 width=44) (actual rows= loops=)

63. 0.000 0.000 ↓ 0.0

Hash Join (cost=4,858.07..129,090.41 rows=4 width=52) (actual rows= loops=)

  • Hash Cond: (p_1.sensor_id = ls.sensor_id)
  • Join Filter: (ls.connected @> p_1.poured_at)
64. 0.000 0.000 ↓ 0.0

Seq Scan on pours p_1 (cost=0.00..124,126.16 rows=9,882 width=48) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 23 or hashed SubPlan 26))
65.          

SubPlan (for Seq Scan)

66. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

67. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((p_1.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 21 or hashed SubPlan 22)))
68.          

SubPlan (for Seq Scan)

69. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
70. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_20 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
71. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_21 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
72. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_22 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('pours#select'::text ~* (('^'::text || permission) || '$'::text))
73. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

74. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_1 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 24 or hashed SubPlan 25)))
75.          

SubPlan (for Seq Scan)

76. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_1.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
77. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_23 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
78. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_24 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
79. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_25 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('pours#select'::text ~* (('^'::text || permission) || '$'::text))
80. 0.000 0.000 ↓ 0.0

Hash (cost=4,857.51..4,857.51 rows=45 width=22) (actual rows= loops=)

81. 0.000 0.000 ↓ 0.0

Seq Scan on line_sensors ls (cost=0.00..4,857.51 rows=45 width=22) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 73 or hashed SubPlan 102))
82.          

SubPlan (for Seq Scan)

83. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..54.55 rows=1 width=0) (actual rows= loops=)

84. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..54.51 rows=1 width=0) (actual rows= loops=)

85. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..46.29 rows=1 width=0) (actual rows= loops=)

86. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..44.01 rows=1 width=4) (actual rows= loops=)

87. 0.000 0.000 ↓ 0.0

Index Scan using sensors_pkey on sensors s_3 (cost=0.14..28.68 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = ls.sensor_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 55 or hashed SubPlan 64))
88.          

SubPlan (for Index Scan)

89. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.15..20.50 rows=1 width=0) (actual rows= loops=)

90. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..20.47 rows=1 width=0) (actual rows= loops=)

  • Join Filter: (b_4.gateway_id = g_10.id)
91. 0.000 0.000 ↓ 0.0

Index Scan using brus_pkey on brus b_4 (cost=0.14..14.35 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = s_3.bru_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 49 or hashed SubPlan 52))
92.          

SubPlan (for Index Scan)

93. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

94. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_8 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_4.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 47 or hashed SubPlan 48)))
95.          

SubPlan (for Seq Scan)

96. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_8.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
97. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_46 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
98. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_47 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
99. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_48 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
100. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

101. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_9 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 50 or hashed SubPlan 51)))
102.          

SubPlan (for Seq Scan)

103. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_9.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
104. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_49 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
105. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_50 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
106. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_51 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
107. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_10 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 53 or hashed SubPlan 54)))
108.          

SubPlan (for Seq Scan)

109. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_10.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
110. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_52 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
111. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_53 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
112. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_54 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('sensors#select'::text ~* (('^'::text || permission) || '$'::text))
113. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..356.83 rows=2 width=4) (actual rows= loops=)

  • Join Filter: (g_13.id = b_5.gateway_id)
114. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

115. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_63 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('sensors#select'::text ~* (('^'::text || permission) || '$'::text))
116. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_13 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 62 or hashed SubPlan 63)))
117.          

SubPlan (for Seq Scan)

118. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_13.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
119. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_61 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
120. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_62 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
121. 0.000 0.000 ↓ 0.0

Seq Scan on brus b_5 (cost=0.00..350.34 rows=28 width=8) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 58 or hashed SubPlan 61))
122.          

SubPlan (for Seq Scan)

123. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

124. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_11 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_5.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 56 or hashed SubPlan 57)))
125.          

SubPlan (for Seq Scan)

126. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_11.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
127. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_55 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
128. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_56 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
129. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_57 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
130. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

131. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_12 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 59 or hashed SubPlan 60)))
132.          

SubPlan (for Seq Scan)

133. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_12.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
134. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_58 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
135. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_59 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
136. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_60 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
137. 0.000 0.000 ↓ 0.0

Index Scan using brus_pkey on brus b_6 (cost=0.14..14.35 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = s_3.bru_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 67 or hashed SubPlan 70))
138.          

SubPlan (for Index Scan)

139. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

140. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_14 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_6.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 65 or hashed SubPlan 66)))
141.          

SubPlan (for Seq Scan)

142. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_14.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
143. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_64 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
144. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_65 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
145. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_66 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
146. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

147. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_15 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 68 or hashed SubPlan 69)))
148.          

SubPlan (for Seq Scan)

149. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_15.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
150. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_67 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
151. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_68 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
152. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_69 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
153. 0.000 0.000 ↓ 0.0

Index Scan using gateways_pkey on gateways g_16 (cost=0.14..1.21 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = b_6.gateway_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 71 or hashed SubPlan 72)))
154.          

SubPlan (for Index Scan)

155. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_16.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
156. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_70 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
157. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_71 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
158. 0.000 0.000 ↓ 0.0

Index Scan using lines_pkey on lines l_2 (cost=0.14..8.21 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = ls.line_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 45 or hashed SubPlan 46)))
159.          

SubPlan (for Index Scan)

160. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_2.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
161. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_44 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
162. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_45 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
163. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_72 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('line_sensors#select'::text ~* (('^'::text || permission) || '$'::text))
164. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..4,369.39 rows=26 width=8) (actual rows= loops=)

165. 0.000 0.000 ↓ 0.0

Seq Scan on lines l_3 (cost=0.00..9.93 rows=9 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 74 or hashed SubPlan 75)))
166.          

SubPlan (for Seq Scan)

167. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_3.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
168. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_73 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
169. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_74 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
170. 0.000 0.000 ↓ 0.0

Materialize (cost=0.01..4,359.12 rows=3 width=4) (actual rows= loops=)

171. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..4,359.11 rows=3 width=4) (actual rows= loops=)

  • Join Filter: (b_9.id = s_4.bru_id)
172. 0.000 0.000 ↓ 0.0

Seq Scan on sensors s_4 (cost=0.00..3,999.37 rows=97 width=8) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 84 or hashed SubPlan 93))
173.          

SubPlan (for Seq Scan)

174. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.15..20.50 rows=1 width=0) (actual rows= loops=)

175. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..20.47 rows=1 width=0) (actual rows= loops=)

  • Join Filter: (b_7.gateway_id = g_19.id)
176. 0.000 0.000 ↓ 0.0

Index Scan using brus_pkey on brus b_7 (cost=0.14..14.35 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = s_4.bru_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 78 or hashed SubPlan 81))
177.          

SubPlan (for Index Scan)

178. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

179. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_17 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_7.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 76 or hashed SubPlan 77)))
180.          

SubPlan (for Seq Scan)

181. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_17.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
182. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_75 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
183. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_76 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
184. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_77 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
185. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

186. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_18 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 79 or hashed SubPlan 80)))
187.          

SubPlan (for Seq Scan)

188. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_18.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
189. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_78 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
190. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_79 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
191. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_80 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
192. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_19 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 82 or hashed SubPlan 83)))
193.          

SubPlan (for Seq Scan)

194. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_19.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
195. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_81 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
196. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_82 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
197. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_83 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('sensors#select'::text ~* (('^'::text || permission) || '$'::text))
198. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..356.83 rows=2 width=4) (actual rows= loops=)

  • Join Filter: (g_22.id = b_8.gateway_id)
199. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

200. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_92 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('sensors#select'::text ~* (('^'::text || permission) || '$'::text))
201. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_22 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 91 or hashed SubPlan 92)))
202.          

SubPlan (for Seq Scan)

203. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_22.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
204. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_90 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
205. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_91 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
206. 0.000 0.000 ↓ 0.0

Seq Scan on brus b_8 (cost=0.00..350.34 rows=28 width=8) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 87 or hashed SubPlan 90))
207.          

SubPlan (for Seq Scan)

208. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

209. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_20 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_8.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 85 or hashed SubPlan 86)))
210.          

SubPlan (for Seq Scan)

211. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_20.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
212. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_84 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
213. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_85 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
214. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_86 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
215. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

216. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_21 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 88 or hashed SubPlan 89)))
217.          

SubPlan (for Seq Scan)

218. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_21.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
219. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_87 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
220. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_88 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
221. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_89 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
222. 0.000 0.000 ↓ 0.0

Materialize (cost=0.01..356.84 rows=2 width=4) (actual rows= loops=)

223. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..356.83 rows=2 width=4) (actual rows= loops=)

  • Join Filter: (g_25.id = b_9.gateway_id)
224. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

225. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_101 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('line_sensors#select'::text ~* (('^'::text || permission) || '$'::text))
226. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_25 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 100 or hashed SubPlan 101)))
227.          

SubPlan (for Seq Scan)

228. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_25.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
229. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_99 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
230. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_100 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
231. 0.000 0.000 ↓ 0.0

Seq Scan on brus b_9 (cost=0.00..350.34 rows=28 width=8) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 96 or hashed SubPlan 99))
232.          

SubPlan (for Seq Scan)

233. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

234. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_23 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_9.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 94 or hashed SubPlan 95)))
235.          

SubPlan (for Seq Scan)

236. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_23.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
237. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_93 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
238. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_94 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
239. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_95 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
240. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

241. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_24 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 97 or hashed SubPlan 98)))
242.          

SubPlan (for Seq Scan)

243. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_24.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
244. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_96 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
245. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_97 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
246. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_98 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
247. 0.000 0.000 ↓ 0.0

Index Scan using sensors_pkey on sensors s (cost=0.14..20.68 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = p_1.sensor_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 35 or hashed SubPlan 44))
248.          

SubPlan (for Index Scan)

249. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.15..20.50 rows=1 width=0) (actual rows= loops=)

250. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..20.47 rows=1 width=0) (actual rows= loops=)

  • Join Filter: (b_2.gateway_id = g_4.id)
251. 0.000 0.000 ↓ 0.0

Index Scan using brus_pkey on brus b_2 (cost=0.14..14.35 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = s.bru_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 29 or hashed SubPlan 32))
252.          

SubPlan (for Index Scan)

253. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

254. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_2 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_2.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 27 or hashed SubPlan 28)))
255.          

SubPlan (for Seq Scan)

256. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_2.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
257. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_26 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
258. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_27 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
259. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_28 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
260. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

261. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_3 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 30 or hashed SubPlan 31)))
262.          

SubPlan (for Seq Scan)

263. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_3.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
264. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_29 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
265. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_30 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
266. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_31 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
267. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_4 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 33 or hashed SubPlan 34)))
268.          

SubPlan (for Seq Scan)

269. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_4.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
270. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_32 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
271. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_33 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
272. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_34 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('sensors#select'::text ~* (('^'::text || permission) || '$'::text))
273. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..356.83 rows=2 width=4) (actual rows= loops=)

  • Join Filter: (g_7.id = b_3.gateway_id)
274. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

275. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_43 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('sensors#select'::text ~* (('^'::text || permission) || '$'::text))
276. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_7 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 42 or hashed SubPlan 43)))
277.          

SubPlan (for Seq Scan)

278. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_7.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
279. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_41 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
280. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_42 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
281. 0.000 0.000 ↓ 0.0

Seq Scan on brus b_3 (cost=0.00..350.34 rows=28 width=8) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 38 or hashed SubPlan 41))
282.          

SubPlan (for Seq Scan)

283. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

284. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_5 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_3.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 36 or hashed SubPlan 37)))
285.          

SubPlan (for Seq Scan)

286. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_5.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
287. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_35 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
288. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_36 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
289. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_37 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
290. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

291. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_6 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 39 or hashed SubPlan 40)))
292.          

SubPlan (for Seq Scan)

293. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_6.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
294. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_38 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
295. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_39 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
296. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_40 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
297. 0.000 0.000 ↓ 0.0

Index Scan using line_taps_line on line_taps lt (cost=0.14..16.29 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (line_id = ls.line_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 107 or hashed SubPlan 112))
298.          

SubPlan (for Index Scan)

299. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.44..15.76 rows=1 width=0) (actual rows= loops=)

300. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.43..15.73 rows=1 width=0) (actual rows= loops=)

301. 0.000 0.000 ↓ 0.0

Index Scan using lines_pkey on lines l_4 (cost=0.14..8.21 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = lt.line_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 103 or hashed SubPlan 104)))
302.          

SubPlan (for Index Scan)

303. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_4.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
304. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_102 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
305. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_103 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
306. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on taps t (cost=4.29..7.50 rows=1 width=0) (actual rows= loops=)

  • Recheck Cond: (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
  • Filter: ((lt.tap_id = id) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 105 or hashed SubPlan 106)))
307. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on taps_unique_establishmentidentifier (cost=0.00..4.29 rows=18 width=0) (actual rows= loops=)

  • Index Cond: (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
308.          

SubPlan (for Bitmap Heap Scan)

309. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (t.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
310. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_104 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('taps#select'::text ~* (('^'::text || permission) || '$'::text))
311. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_105 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('taps#select'::text ~* (('^'::text || permission) || '$'::text))
312. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_106 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('line_taps#select'::text ~* (('^'::text || permission) || '$'::text))
313. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.29..18.54 rows=81 width=8) (actual rows= loops=)

314. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..10.04 rows=9 width=4) (actual rows= loops=)

315. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_111 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('line_taps#select'::text ~* (('^'::text || permission) || '$'::text))
316. 0.000 0.000 ↓ 0.0

Seq Scan on lines l_5 (cost=0.00..9.93 rows=9 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 108 or hashed SubPlan 109)))
317.          

SubPlan (for Seq Scan)

318. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_5.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
319. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_107 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
320. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_108 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
321. 0.000 0.000 ↓ 0.0

Materialize (cost=4.29..7.50 rows=9 width=4) (actual rows= loops=)

322. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on taps t_1 (cost=4.29..7.46 rows=9 width=4) (actual rows= loops=)

  • Recheck Cond: (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 110 or hashed SubPlan 111))
323. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on taps_unique_establishmentidentifier (cost=0.00..4.29 rows=18 width=0) (actual rows= loops=)

  • Index Cond: (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
324.          

SubPlan (for Bitmap Heap Scan)

325. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (t_1.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
326. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_109 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('taps#select'::text ~* (('^'::text || permission) || '$'::text))
327. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_110 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('taps#select'::text ~* (('^'::text || permission) || '$'::text))
328. 0.000 0.000 ↓ 0.0

Index Scan using item_lines_uniquequeueindexperline on item_lines il (cost=0.28..134.44 rows=2 width=27) (actual rows= loops=)

  • Index Cond: (line_id = ls.line_id)
  • Filter: (((queue_index = '0'::double precision) OR ((queue_index IS NULL) AND (connected_to IS NOT NULL) AND (connected_from IS NOT NULL))) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 117 or hashed SubPlan 122)))
329.          

SubPlan (for Index Scan)

330. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..16.61 rows=1 width=0) (actual rows= loops=)

331. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..16.57 rows=1 width=0) (actual rows= loops=)

332. 0.000 0.000 ↓ 0.0

Index Scan using lines_pkey on lines l_6 (cost=0.14..8.21 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = il.line_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 113 or hashed SubPlan 114)))
333.          

SubPlan (for Index Scan)

334. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_6.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
335. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_112 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
336. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_113 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
337. 0.000 0.000 ↓ 0.0

Index Scan using items_pkey on items i_6 (cost=0.28..8.35 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = il.item_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 115 or hashed SubPlan 116)))
338.          

SubPlan (for Index Scan)

339. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (i_6.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
340. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_114 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
341. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_115 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
342. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_116 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('item_lines#select'::text ~* (('^'::text || permission) || '$'::text))
343. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..71.77 rows=639 width=8) (actual rows= loops=)

344. 0.000 0.000 ↓ 0.0

Seq Scan on items i_7 (cost=0.00..53.72 rows=71 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 120 or hashed SubPlan 121)))
345.          

SubPlan (for Seq Scan)

346. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (i_7.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
347. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_119 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
348. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_120 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
349. 0.000 0.000 ↓ 0.0

Materialize (cost=0.01..10.09 rows=9 width=4) (actual rows= loops=)

350. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..10.04 rows=9 width=4) (actual rows= loops=)

351. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_121 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('item_lines#select'::text ~* (('^'::text || permission) || '$'::text))
352. 0.000 0.000 ↓ 0.0

Seq Scan on lines l_7 (cost=0.00..9.93 rows=9 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 118 or hashed SubPlan 119)))
353.          

SubPlan (for Seq Scan)

354. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_7.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
355. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_117 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
356. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_118 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
357. 0.000 0.000 ↓ 0.0

Index Scan using items_pkey on items i_1 (cost=0.28..0.61 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = il.item_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 123 or hashed SubPlan 124))
358.          

SubPlan (for Index Scan)

359. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (i_1.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
360. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_122 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
361. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_123 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
362. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=1.53..44,664.71 rows=1 width=44) (actual rows= loops=)

  • Group Key: i_2.id
363. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.53..44,664.66 rows=1 width=36) (actual rows= loops=)

  • Join Filter: ((b_1.id = i_2.beverage_id) AND (il_1.item_id = i_2.id))
364. 0.000 0.000 ↓ 0.0

Index Scan using items_pkey on items i_2 (cost=0.28..70.60 rows=346 width=8) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 169 or hashed SubPlan 170))
365.          

SubPlan (for Index Scan)

366. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (i_2.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
367. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_164 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
368. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_165 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
369. 0.000 0.000 ↓ 0.0

Materialize (cost=1.25..44,588.01 rows=1 width=44) (actual rows= loops=)

370. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.25..44,588.00 rows=1 width=44) (actual rows= loops=)

  • Join Filter: (lt_1.connected @> s_1.sold_at)
371. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.13..44,572.03 rows=1 width=48) (actual rows= loops=)

372. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.71..44,563.84 rows=1 width=44) (actual rows= loops=)

  • Join Filter: (c_1.volume_unit_id = u_1.id)
373. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.71..44,562.70 rows=1 width=44) (actual rows= loops=)

  • Join Filter: (bs.container_id = c_1.id)
374. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.71..44,543.86 rows=1 width=40) (actual rows= loops=)

375. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..44,535.09 rows=1 width=32) (actual rows= loops=)

  • Join Filter: (((s_1.token)::text = (ps.token)::text) AND (ij.establishment_id = ps.establishment_id) AND (ij.integration_id = ps.integration_id) AND (ps.effective @> s_1.sold_at))
376. 0.000 0.000 ↓ 0.0

Seq Scan on pos_skus ps (cost=0.00..64.70 rows=372 width=50) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 137 or hashed SubPlan 138))
377.          

SubPlan (for Seq Scan)

378. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (ps.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
379. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_132 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('pos_skus#select'::text ~* (('^'::text || permission) || '$'::text))
380. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_133 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('pos_skus#select'::text ~* (('^'::text || permission) || '$'::text))
381. 0.000 0.000 ↓ 0.0

Materialize (cost=0.43..44,411.82 rows=7 width=54) (actual rows= loops=)

382. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..44,411.78 rows=7 width=54) (actual rows= loops=)

  • Join Filter: (il_1.connected @> s_1.sold_at)
383. 0.000 0.000 ↓ 0.0

Index Scan using item_lines_tsrange on item_lines il_1 (cost=0.14..9,490.14 rows=284 width=27) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 153 or hashed SubPlan 158))
384.          

SubPlan (for Index Scan)

385. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..16.61 rows=1 width=0) (actual rows= loops=)

386. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..16.57 rows=1 width=0) (actual rows= loops=)

387. 0.000 0.000 ↓ 0.0

Index Scan using lines_pkey on lines l_8 (cost=0.14..8.21 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = il_1.line_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 149 or hashed SubPlan 150)))
388.          

SubPlan (for Index Scan)

389. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_8.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
390. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_144 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
391. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_145 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
392. 0.000 0.000 ↓ 0.0

Index Scan using items_pkey on items i_8 (cost=0.28..8.35 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = il_1.item_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 151 or hashed SubPlan 152)))
393.          

SubPlan (for Index Scan)

394. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (i_8.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
395. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_146 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
396. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_147 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
397. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_148 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('item_lines#select'::text ~* (('^'::text || permission) || '$'::text))
398. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..71.77 rows=639 width=8) (actual rows= loops=)

399. 0.000 0.000 ↓ 0.0

Seq Scan on items i_9 (cost=0.00..53.72 rows=71 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 156 or hashed SubPlan 157)))
400.          

SubPlan (for Seq Scan)

401. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (i_9.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
402. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_151 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
403. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_152 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
404. 0.000 0.000 ↓ 0.0

Materialize (cost=0.01..10.09 rows=9 width=4) (actual rows= loops=)

405. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..10.04 rows=9 width=4) (actual rows= loops=)

406. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_153 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('item_lines#select'::text ~* (('^'::text || permission) || '$'::text))
407. 0.000 0.000 ↓ 0.0

Seq Scan on lines l_9 (cost=0.00..9.93 rows=9 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 154 or hashed SubPlan 155)))
408.          

SubPlan (for Seq Scan)

409. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_9.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
410. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_149 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
411. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_150 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
412. 0.000 0.000 ↓ 0.0

Materialize (cost=0.29..34,819.46 rows=24 width=46) (actual rows= loops=)

413. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..34,819.34 rows=24 width=46) (actual rows= loops=)

414. 0.000 0.000 ↓ 0.0

Seq Scan on integration_jobs ij (cost=0.00..2.98 rows=18 width=12) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 135 or hashed SubPlan 136))
415.          

SubPlan (for Seq Scan)

416. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (ij.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
417. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_130 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('integration_jobs#select'::text ~* (('^'::text || permission) || '$'::text))
418. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_131 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('integration_jobs#select'::text ~* (('^'::text || permission) || '$'::text))
419. 0.000 0.000 ↓ 0.0

Index Scan using pos_sales_integrationjob on pos_sales s_1 (cost=0.29..1,934.23 rows=1 width=42) (actual rows= loops=)

  • Index Cond: (integration_job_id = ij.id)
  • Filter: ((((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 131 or hashed SubPlan 134)) AND ('(,)'::tsrange @> sold_at))
420.          

SubPlan (for Index Scan)

421. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..3.46 rows=1 width=0) (actual rows= loops=)

422. 0.000 0.000 ↓ 0.0

Seq Scan on integration_jobs ij_1 (cost=0.00..3.43 rows=1 width=0) (actual rows= loops=)

  • Filter: ((s_1.integration_job_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 129 or hashed SubPlan 130)))
423.          

SubPlan (for Seq Scan)

424. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (ij_1.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
425. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_124 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('integration_jobs#select'::text ~* (('^'::text || permission) || '$'::text))
426. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_125 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('integration_jobs#select'::text ~* (('^'::text || permission) || '$'::text))
427. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_126 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('pos_sales#select'::text ~* (('^'::text || permission) || '$'::text))
428. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..3.51 rows=15 width=4) (actual rows= loops=)

429. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_129 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('pos_sales#select'::text ~* (('^'::text || permission) || '$'::text))
430. 0.000 0.000 ↓ 0.0

Seq Scan on integration_jobs ij_2 (cost=0.00..3.34 rows=15 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 132 or hashed SubPlan 133)))
431.          

SubPlan (for Seq Scan)

432. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (ij_2.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
433. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_127 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('integration_jobs#select'::text ~* (('^'::text || permission) || '$'::text))
434. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_128 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('integration_jobs#select'::text ~* (('^'::text || permission) || '$'::text))
435. 0.000 0.000 ↓ 0.0

Index Scan using skus_pkey on skus bs (cost=0.28..8.71 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = ps.sku_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 141 or hashed SubPlan 144))
436.          

SubPlan (for Index Scan)

437. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.15..8.26 rows=1 width=0) (actual rows= loops=)

438. 0.000 0.000 ↓ 0.0

Index Scan using containers_pkey on containers c_2 (cost=0.14..8.22 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = bs.container_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (establishment_id = 0) OR (alternatives: SubPlan 139 or hashed SubPlan 140)))
439.          

SubPlan (for Index Scan)

440. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (c_2.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
441. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_134 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('containers#select'::text ~* (('^'::text || permission) || '$'::text))
442. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_135 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('containers#select'::text ~* (('^'::text || permission) || '$'::text))
443. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_136 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('skus#select'::text ~* (('^'::text || permission) || '$'::text))
444. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..19.37 rows=5 width=4) (actual rows= loops=)

445. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_139 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('skus#select'::text ~* (('^'::text || permission) || '$'::text))
446. 0.000 0.000 ↓ 0.0

Seq Scan on containers c_3 (cost=0.00..19.30 rows=5 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (establishment_id = 0) OR (alternatives: SubPlan 142 or hashed SubPlan 143)))
447.          

SubPlan (for Seq Scan)

448. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (c_3.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
449. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_137 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('containers#select'::text ~* (('^'::text || permission) || '$'::text))
450. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_138 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('containers#select'::text ~* (('^'::text || permission) || '$'::text))
451. 0.000 0.000 ↓ 0.0

Seq Scan on containers c_1 (cost=0.00..17.33 rows=121 width=12) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (establishment_id = 0) OR (alternatives: SubPlan 145 or hashed SubPlan 146))
452.          

SubPlan (for Seq Scan)

453. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (c_1.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
454. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_140 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('containers#select'::text ~* (('^'::text || permission) || '$'::text))
455. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_141 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('containers#select'::text ~* (('^'::text || permission) || '$'::text))
456. 0.000 0.000 ↓ 0.0

Seq Scan on units u_1 (cost=0.00..1.06 rows=6 width=8) (actual rows= loops=)

457. 0.000 0.000 ↓ 0.0

Index Scan using beverages_pkey on beverages b_1 (cost=0.42..8.20 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = bs.beverage_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (establishment_id = 0) OR (alternatives: SubPlan 147 or hashed SubPlan 148))
458.          

SubPlan (for Index Scan)

459. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (b_1.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
460. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_142 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('beverages#select'::text ~* (('^'::text || permission) || '$'::text))
461. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_143 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('beverages#select'::text ~* (('^'::text || permission) || '$'::text))
462. 0.000 0.000 ↓ 0.0

Index Scan using line_taps_tsrange on line_taps lt_1 (cost=0.12..15.96 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (line_id = il_1.line_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 163 or hashed SubPlan 168))
463.          

SubPlan (for Index Scan)

464. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.44..15.76 rows=1 width=0) (actual rows= loops=)

465. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.43..15.73 rows=1 width=0) (actual rows= loops=)

466. 0.000 0.000 ↓ 0.0

Index Scan using lines_pkey on lines l_10 (cost=0.14..8.21 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = lt_1.line_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 159 or hashed SubPlan 160)))
467.          

SubPlan (for Index Scan)

468. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_10.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
469. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_154 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
470. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_155 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
471. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on taps t_2 (cost=4.29..7.50 rows=1 width=0) (actual rows= loops=)

  • Recheck Cond: (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
  • Filter: ((lt_1.tap_id = id) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 161 or hashed SubPlan 162)))
472. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on taps_unique_establishmentidentifier (cost=0.00..4.29 rows=18 width=0) (actual rows= loops=)

  • Index Cond: (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
473.          

SubPlan (for Bitmap Heap Scan)

474. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (t_2.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
475. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_156 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('taps#select'::text ~* (('^'::text || permission) || '$'::text))
476. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_157 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('taps#select'::text ~* (('^'::text || permission) || '$'::text))
477. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_158 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('line_taps#select'::text ~* (('^'::text || permission) || '$'::text))
478. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.29..18.54 rows=81 width=8) (actual rows= loops=)

479. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..10.04 rows=9 width=4) (actual rows= loops=)

480. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_163 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('line_taps#select'::text ~* (('^'::text || permission) || '$'::text))
481. 0.000 0.000 ↓ 0.0

Seq Scan on lines l_11 (cost=0.00..9.93 rows=9 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 164 or hashed SubPlan 165)))
482.          

SubPlan (for Seq Scan)

483. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_11.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
484. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_159 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
485. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_160 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
486. 0.000 0.000 ↓ 0.0

Materialize (cost=4.29..7.50 rows=9 width=4) (actual rows= loops=)

487. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on taps t_3 (cost=4.29..7.46 rows=9 width=4) (actual rows= loops=)

  • Recheck Cond: (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 166 or hashed SubPlan 167))
488. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on taps_unique_establishmentidentifier (cost=0.00..4.29 rows=18 width=0) (actual rows= loops=)

  • Index Cond: (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
489.          

SubPlan (for Bitmap Heap Scan)

490. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (t_3.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
491. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_161 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('taps#select'::text ~* (('^'::text || permission) || '$'::text))
492. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_162 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('taps#select'::text ~* (('^'::text || permission) || '$'::text))
493. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=0.28..21,936.91 rows=615 width=44) (actual rows= loops=)

  • Group Key: ie_1.item_id
494. 0.000 0.000 ↓ 0.0

Index Scan using item_events_item on item_events ie_1 (cost=0.28..21,894.99 rows=1,301 width=16) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 173 or hashed SubPlan 176))
495.          

SubPlan (for Index Scan)

496. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.28..8.38 rows=1 width=0) (actual rows= loops=)

497. 0.000 0.000 ↓ 0.0

Index Scan using items_pkey on items i_10 (cost=0.28..8.35 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = ie_1.item_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 171 or hashed SubPlan 172)))
498.          

SubPlan (for Index Scan)

499. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (i_10.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
500. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_166 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
501. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_167 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
502. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_168 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('item_events#select'::text ~* (('^'::text || permission) || '$'::text))
503. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..54.45 rows=71 width=4) (actual rows= loops=)

504. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_171 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('item_events#select'::text ~* (('^'::text || permission) || '$'::text))
505. 0.000 0.000 ↓ 0.0

Seq Scan on items i_11 (cost=0.00..53.72 rows=71 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 174 or hashed SubPlan 175)))
506.          

SubPlan (for Seq Scan)

507. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (i_11.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
508. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_169 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
509. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_170 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('items#select'::text ~* (('^'::text || permission) || '$'::text))
510. 0.000 0.000 ↓ 0.0

Unique (cost=129,324.94..129,324.95 rows=1 width=96) (actual rows= loops=)

511. 0.000 0.000 ↓ 0.0

Sort (cost=129,324.94..129,324.95 rows=1 width=96) (actual rows= loops=)

  • Sort Key: i_3.id, p_2.poured_at DESC
512. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=4,858.91..129,324.93 rows=1 width=96) (actual rows= loops=)

513. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,858.63..129,324.33 rows=1 width=20) (actual rows= loops=)

  • Join Filter: (il_2.connected @> p_2.poured_at)
514. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=4,858.36..129,189.86 rows=1 width=20) (actual rows= loops=)

  • Join Filter: (lt_2.connected @> p_2.poured_at)
515. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,858.21..129,173.56 rows=1 width=20) (actual rows= loops=)

516. 0.000 0.000 ↓ 0.0

Hash Join (cost=4,858.07..129,090.41 rows=4 width=28) (actual rows= loops=)

  • Hash Cond: (p_2.sensor_id = ls_1.sensor_id)
  • Join Filter: (ls_1.connected @> p_2.poured_at)
517. 0.000 0.000 ↓ 0.0

Seq Scan on pours p_2 (cost=0.00..124,126.16 rows=9,882 width=24) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 179 or hashed SubPlan 182))
518.          

SubPlan (for Seq Scan)

519. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

520. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_26 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((p_2.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 177 or hashed SubPlan 178)))
521.          

SubPlan (for Seq Scan)

522. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_26.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
523. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_172 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
524. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_173 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
525. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_174 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('pours#select'::text ~* (('^'::text || permission) || '$'::text))
526. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

527. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_27 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 180 or hashed SubPlan 181)))
528.          

SubPlan (for Seq Scan)

529. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_27.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
530. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_175 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
531. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_176 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
532. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_177 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('pours#select'::text ~* (('^'::text || permission) || '$'::text))
533. 0.000 0.000 ↓ 0.0

Hash (cost=4,857.51..4,857.51 rows=45 width=22) (actual rows= loops=)

534. 0.000 0.000 ↓ 0.0

Seq Scan on line_sensors ls_1 (cost=0.00..4,857.51 rows=45 width=22) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 229 or hashed SubPlan 258))
535.          

SubPlan (for Seq Scan)

536. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..54.55 rows=1 width=0) (actual rows= loops=)

537. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..54.51 rows=1 width=0) (actual rows= loops=)

538. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..46.29 rows=1 width=0) (actual rows= loops=)

539. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..44.01 rows=1 width=4) (actual rows= loops=)

540. 0.000 0.000 ↓ 0.0

Index Scan using sensors_pkey on sensors s_5 (cost=0.14..28.68 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = ls_1.sensor_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 211 or hashed SubPlan 220))
541.          

SubPlan (for Index Scan)

542. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.15..20.50 rows=1 width=0) (actual rows= loops=)

543. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..20.47 rows=1 width=0) (actual rows= loops=)

  • Join Filter: (b_12.gateway_id = g_36.id)
544. 0.000 0.000 ↓ 0.0

Index Scan using brus_pkey on brus b_12 (cost=0.14..14.35 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = s_5.bru_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 205 or hashed SubPlan 208))
545.          

SubPlan (for Index Scan)

546. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

547. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_34 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_12.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 203 or hashed SubPlan 204)))
548.          

SubPlan (for Seq Scan)

549. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_34.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
550. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_198 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
551. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_199 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
552. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_200 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
553. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

554. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_35 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 206 or hashed SubPlan 207)))
555.          

SubPlan (for Seq Scan)

556. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_35.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
557. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_201 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
558. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_202 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
559. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_203 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
560. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_36 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 209 or hashed SubPlan 210)))
561.          

SubPlan (for Seq Scan)

562. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_36.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
563. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_204 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
564. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_205 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
565. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_206 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('sensors#select'::text ~* (('^'::text || permission) || '$'::text))
566. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..356.83 rows=2 width=4) (actual rows= loops=)

  • Join Filter: (g_39.id = b_13.gateway_id)
567. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

568. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_215 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('sensors#select'::text ~* (('^'::text || permission) || '$'::text))
569. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_39 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 218 or hashed SubPlan 219)))
570.          

SubPlan (for Seq Scan)

571. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_39.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
572. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_213 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
573. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_214 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
574. 0.000 0.000 ↓ 0.0

Seq Scan on brus b_13 (cost=0.00..350.34 rows=28 width=8) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 214 or hashed SubPlan 217))
575.          

SubPlan (for Seq Scan)

576. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

577. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_37 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_13.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 212 or hashed SubPlan 213)))
578.          

SubPlan (for Seq Scan)

579. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_37.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
580. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_207 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
581. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_208 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
582. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_209 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
583. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

584. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_38 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 215 or hashed SubPlan 216)))
585.          

SubPlan (for Seq Scan)

586. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_38.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
587. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_210 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
588. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_211 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
589. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_212 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
590. 0.000 0.000 ↓ 0.0

Index Scan using brus_pkey on brus b_14 (cost=0.14..14.35 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = s_5.bru_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 223 or hashed SubPlan 226))
591.          

SubPlan (for Index Scan)

592. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

593. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_40 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_14.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 221 or hashed SubPlan 222)))
594.          

SubPlan (for Seq Scan)

595. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_40.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
596. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_216 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
597. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_217 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
598. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_218 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
599. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

600. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_41 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 224 or hashed SubPlan 225)))
601.          

SubPlan (for Seq Scan)

602. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_41.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
603. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_219 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
604. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_220 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
605. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_221 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
606. 0.000 0.000 ↓ 0.0

Index Scan using gateways_pkey on gateways g_42 (cost=0.14..1.21 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = b_14.gateway_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 227 or hashed SubPlan 228)))
607.          

SubPlan (for Index Scan)

608. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_42.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
609. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_222 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
610. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_223 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
611. 0.000 0.000 ↓ 0.0

Index Scan using lines_pkey on lines l_12 (cost=0.14..8.21 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = ls_1.line_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 201 or hashed SubPlan 202)))
612.          

SubPlan (for Index Scan)

613. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_12.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
614. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_196 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
615. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_197 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
616. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_224 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('line_sensors#select'::text ~* (('^'::text || permission) || '$'::text))
617. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..4,369.39 rows=26 width=8) (actual rows= loops=)

618. 0.000 0.000 ↓ 0.0

Seq Scan on lines l_13 (cost=0.00..9.93 rows=9 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 230 or hashed SubPlan 231)))
619.          

SubPlan (for Seq Scan)

620. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_13.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
621. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_225 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
622. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_226 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
623. 0.000 0.000 ↓ 0.0

Materialize (cost=0.01..4,359.12 rows=3 width=4) (actual rows= loops=)

624. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..4,359.11 rows=3 width=4) (actual rows= loops=)

  • Join Filter: (b_17.id = s_6.bru_id)
625. 0.000 0.000 ↓ 0.0

Seq Scan on sensors s_6 (cost=0.00..3,999.37 rows=97 width=8) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 240 or hashed SubPlan 249))
626.          

SubPlan (for Seq Scan)

627. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.15..20.50 rows=1 width=0) (actual rows= loops=)

628. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..20.47 rows=1 width=0) (actual rows= loops=)

  • Join Filter: (b_15.gateway_id = g_45.id)
629. 0.000 0.000 ↓ 0.0

Index Scan using brus_pkey on brus b_15 (cost=0.14..14.35 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = s_6.bru_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 234 or hashed SubPlan 237))
630.          

SubPlan (for Index Scan)

631. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

632. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_43 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_15.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 232 or hashed SubPlan 233)))
633.          

SubPlan (for Seq Scan)

634. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_43.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
635. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_227 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
636. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_228 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
637. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_229 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
638. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

639. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_44 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 235 or hashed SubPlan 236)))
640.          

SubPlan (for Seq Scan)

641. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_44.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
642. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_230 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
643. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_231 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
644. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_232 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
645. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_45 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 238 or hashed SubPlan 239)))
646.          

SubPlan (for Seq Scan)

647. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_45.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
648. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_233 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
649. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_234 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
650. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_235 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('sensors#select'::text ~* (('^'::text || permission) || '$'::text))
651. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..356.83 rows=2 width=4) (actual rows= loops=)

  • Join Filter: (g_48.id = b_16.gateway_id)
652. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

653. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_244 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('sensors#select'::text ~* (('^'::text || permission) || '$'::text))
654. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_48 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 247 or hashed SubPlan 248)))
655.          

SubPlan (for Seq Scan)

656. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_48.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
657. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_242 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
658. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_243 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
659. 0.000 0.000 ↓ 0.0

Seq Scan on brus b_16 (cost=0.00..350.34 rows=28 width=8) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 243 or hashed SubPlan 246))
660.          

SubPlan (for Seq Scan)

661. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

662. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_46 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_16.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 241 or hashed SubPlan 242)))
663.          

SubPlan (for Seq Scan)

664. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_46.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
665. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_236 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
666. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_237 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
667. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_238 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
668. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

669. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_47 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 244 or hashed SubPlan 245)))
670.          

SubPlan (for Seq Scan)

671. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_47.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
672. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_239 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
673. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_240 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
674. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_241 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
675. 0.000 0.000 ↓ 0.0

Materialize (cost=0.01..356.84 rows=2 width=4) (actual rows= loops=)

676. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..356.83 rows=2 width=4) (actual rows= loops=)

  • Join Filter: (g_51.id = b_17.gateway_id)
677. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

678. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_253 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('line_sensors#select'::text ~* (('^'::text || permission) || '$'::text))
679. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_51 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 256 or hashed SubPlan 257)))
680.          

SubPlan (for Seq Scan)

681. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_51.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
682. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_251 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
683. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_252 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
684. 0.000 0.000 ↓ 0.0

Seq Scan on brus b_17 (cost=0.00..350.34 rows=28 width=8) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 252 or hashed SubPlan 255))
685.          

SubPlan (for Seq Scan)

686. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

687. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_49 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_17.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 250 or hashed SubPlan 251)))
688.          

SubPlan (for Seq Scan)

689. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_49.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
690. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_245 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
691. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_246 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
692. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_247 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
693. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

694. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_50 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 253 or hashed SubPlan 254)))
695.          

SubPlan (for Seq Scan)

696. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_50.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
697. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_248 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
698. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_249 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
699. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_250 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
700. 0.000 0.000 ↓ 0.0

Index Scan using sensors_pkey on sensors s_2 (cost=0.14..20.68 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = p_2.sensor_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 191 or hashed SubPlan 200))
701.          

SubPlan (for Index Scan)

702. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.15..20.50 rows=1 width=0) (actual rows= loops=)

703. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..20.47 rows=1 width=0) (actual rows= loops=)

  • Join Filter: (b_10.gateway_id = g_30.id)
704. 0.000 0.000 ↓ 0.0

Index Scan using brus_pkey on brus b_10 (cost=0.14..14.35 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = s_2.bru_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 185 or hashed SubPlan 188))
705.          

SubPlan (for Index Scan)

706. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

707. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_28 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_10.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 183 or hashed SubPlan 184)))
708.          

SubPlan (for Seq Scan)

709. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_28.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
710. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_178 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
711. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_179 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
712. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_180 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
713. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

714. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_29 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 186 or hashed SubPlan 187)))
715.          

SubPlan (for Seq Scan)

716. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_29.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
717. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_181 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
718. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_182 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
719. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_183 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
720. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_30 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 189 or hashed SubPlan 190)))
721.          

SubPlan (for Seq Scan)

722. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_30.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
723. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_184 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
724. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_185 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
725. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_186 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('sensors#select'::text ~* (('^'::text || permission) || '$'::text))
726. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..356.83 rows=2 width=4) (actual rows= loops=)

  • Join Filter: (g_33.id = b_11.gateway_id)
727. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

728. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_195 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('sensors#select'::text ~* (('^'::text || permission) || '$'::text))
729. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_33 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 198 or hashed SubPlan 199)))
730.          

SubPlan (for Seq Scan)

731. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_33.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
732. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_193 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
733. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_194 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
734. 0.000 0.000 ↓ 0.0

Seq Scan on brus b_11 (cost=0.00..350.34 rows=28 width=8) (actual rows= loops=)

  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 194 or hashed SubPlan 197))
735.          

SubPlan (for Seq Scan)

736. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.18 rows=1 width=0) (actual rows= loops=)

737. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_31 (cost=0.00..6.15 rows=1 width=0) (actual rows= loops=)

  • Filter: ((b_11.gateway_id = id) AND (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 192 or hashed SubPlan 193)))
738.          

SubPlan (for Seq Scan)

739. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_31.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
740. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_187 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
741. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_188 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
742. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_189 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
743. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..6.14 rows=1 width=4) (actual rows= loops=)

744. 0.000 0.000 ↓ 0.0

Seq Scan on gateways g_32 (cost=0.00..6.11 rows=1 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 195 or hashed SubPlan 196)))
745.          

SubPlan (for Seq Scan)

746. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (g_32.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
747. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_190 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
748. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_191 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('gateways#select'::text ~* (('^'::text || permission) || '$'::text))
749. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_192 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('brus#select'::text ~* (('^'::text || permission) || '$'::text))
750. 0.000 0.000 ↓ 0.0

Index Scan using line_taps_line on line_taps lt_2 (cost=0.14..16.29 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (line_id = ls_1.line_id)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 263 or hashed SubPlan 268))
751.          

SubPlan (for Index Scan)

752. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.44..15.76 rows=1 width=0) (actual rows= loops=)

753. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.43..15.73 rows=1 width=0) (actual rows= loops=)

754. 0.000 0.000 ↓ 0.0

Index Scan using lines_pkey on lines l_14 (cost=0.14..8.21 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (id = lt_2.line_id)
  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 259 or hashed SubPlan 260)))
755.          

SubPlan (for Index Scan)

756. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_14.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
757. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_254 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
758. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_255 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
759. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on taps t_4 (cost=4.29..7.50 rows=1 width=0) (actual rows= loops=)

  • Recheck Cond: (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
  • Filter: ((lt_2.tap_id = id) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 261 or hashed SubPlan 262)))
760. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on taps_unique_establishmentidentifier (cost=0.00..4.29 rows=18 width=0) (actual rows= loops=)

  • Index Cond: (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
761.          

SubPlan (for Bitmap Heap Scan)

762. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (t_4.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
763. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_256 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('taps#select'::text ~* (('^'::text || permission) || '$'::text))
764. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_257 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('taps#select'::text ~* (('^'::text || permission) || '$'::text))
765. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_258 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('line_taps#select'::text ~* (('^'::text || permission) || '$'::text))
766. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.29..18.54 rows=81 width=8) (actual rows= loops=)

767. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.01..10.04 rows=9 width=4) (actual rows= loops=)

768. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_263 (cost=0.01..0.03 rows=1 width=0) (actual rows= loops=)

  • Filter: ('line_taps#select'::text ~* (('^'::text || permission) || '$'::text))
769. 0.000 0.000 ↓ 0.0

Seq Scan on lines l_15 (cost=0.00..9.93 rows=9 width=4) (actual rows= loops=)

  • Filter: ((establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer) AND (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 264 or hashed SubPlan 265)))
770.          

SubPlan (for Seq Scan)

771. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (l_15.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
772. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_259 (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
773. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_260 (cost=0.01..0.03 rows=1 width=4) (actual rows= loops=)

  • Filter: ('lines#select'::text ~* (('^'::text || permission) || '$'::text))
774. 0.000 0.000 ↓ 0.0

Materialize (cost=4.29..7.50 rows=9 width=4) (actual rows= loops=)

775. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on taps t_5 (cost=4.29..7.46 rows=9 width=4) (actual rows= loops=)

  • Recheck Cond: (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
  • Filter: (((current_setting('bartrack.currentroleuser'::text))::integer = 0) OR (alternatives: SubPlan 266 or hashed SubPlan 267))
776. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on taps_unique_establishmentidentifier (cost=0.00..4.29 rows=18 width=0) (actual rows= loops=)

  • Index Cond: (establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
777.          

SubPlan (for Bitmap Heap Scan)

778. 0.000 0.000 ↓ 0.0

Result (cost=0.02..0.04 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (t_5.establishment_id = (current_setting('bartrack.currentestablishment'::text))::integer)
779. 0.000 0.000 ↓ 0.0

Function Scan on unnest _p_261