· 8 years ago · Feb 19, 2018, 08:10 AM
1(133.9ms) SET NAMES utf8, @@SESSION.sql_mode = 'NO_ENGINE_SUBSTITUTION', @@SESSION.collation_connection = 'utf8_unicode_ci', @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
2 Client Load (284.9ms) SELECT `clients`.* FROM `clients` WHERE `clients`.`id` = 319 LIMIT 1
3 CalendarSchedule Load (133.6ms) SELECT `calendar_schedules`.* FROM `calendar_schedules` WHERE `calendar_schedules`.`client_id` = 319 AND `calendar_schedules`.`id` = 1381 ORDER BY `calendar_schedules`.`position` ASC LIMIT 1
4 CallType Load (143.6ms) SELECT `call_types`.* FROM `call_types` WHERE `call_types`.`id` IN (12692, 12693, 12694, 12705, 12702)
5 CalendarSchedule Load (140.9ms) SELECT `calendar_schedules`.* FROM `calendar_schedules` WHERE `calendar_schedules`.`client_id` = 319 AND `calendar_schedules`.`id` = 1381 ORDER BY `calendar_schedules`.`position` ASC LIMIT 1
6 Block Load (136.4ms) SELECT `blocks`.* FROM `blocks` INNER JOIN `block_schedules` ON `blocks`.`block_schedule_id` = `block_schedules`.`id` WHERE `block_schedules`.`id` = 447 AND `blocks`.`id` = 29251 ORDER BY start_date asc, end_date asc LIMIT 1
7 BlockSchedule Load (147.0ms) SELECT `block_schedules`.* FROM `block_schedules` WHERE `block_schedules`.`id` = 447 LIMIT 1
8 PopulationTimeframe Load (133.9ms) SELECT `population_timeframes`.* FROM `population_timeframes` WHERE `population_timeframes`.`client_id` = 319 AND `population_timeframes`.`timeframe_type` = 1 ORDER BY `population_timeframes`.`id` ASC LIMIT 1
9 RuleSet Load (132.7ms) SELECT `rule_sets`.* FROM `rule_sets` WHERE `rule_sets`.`id` = 1475 LIMIT 1
10 Block Load (135.8ms) SELECT `blocks`.* FROM `blocks` INNER JOIN `block_schedules` ON `blocks`.`block_schedule_id` = `block_schedules`.`id` WHERE `block_schedules`.`id` = 447 AND (blocks.start_date >= '2018-03-01' AND blocks.end_date <= '2018-03-31') ORDER BY start_date asc, end_date asc
11INFO : (02-06 14:06:20) phase: Scheduler::Base
12INFO : (02-06 14:06:20) from: 2018-03-01 to: 2018-03-31
13 Rule Load (136.6ms) SELECT `rules`.* FROM `rules` WHERE `rules`.`rule_set_id` = 1475 ORDER BY applied desc, weight desc
14INFO : (02-06 14:06:20) rule configurations: CAT
15 - 'Cumulative Assignment Targets' applied {"opt1"=>{"applied"=>"1"}, "round_targets"=>"false"} weight:5
16 - 'Cumulative Combined Assignment Targets' not applied
17 - 'Cumulative Daily Assignment Targets' not applied
18 - 'Cumulative Day of Week Targets' not applied
19 - 'Cumulative Hour Targets' not applied
20 - 'Cumulative Point Targets' not applied
21 - 'Cumulative Weekend / Weekday Assignment Targets' not applied
22 - 'Cumulative Weekend / Weekday Combined Assignment Targets' not applied
23 - 'Cumulative Weekend / Weekday Hour Targets' not applied
24 - 'Cumulative Weekend / Weekday Point Targets' not applied
25 - 'Current Assignment Targets' not applied
26 - 'Current Combined Assignment Targets' not applied
27 - 'Current Daily Assignment Targets' not applied
28 - 'Current Day of Week Targets' not applied
29 - 'Current Hour Targets' not applied
30 - 'Current Point Targets' not applied
31 - 'Current Weekend / Weekday Assignment Targets' not applied
32 - 'Current Weekend / Weekday Combined Assignment Targets' not applied
33 - 'Current Weekend / Weekday Hour Targets' not applied
34 - 'Current Weekend / Weekday Point Targets' not applied
35 - 'Pending Call Requests' not applied
36 - 'Pending No-call Requests' not applied
37 - 'Assignments Per Day' not applied
38 - 'Days Between Assignments' not applied
39 - 'Days Between Same Assignment' not applied
40 - 'Unassigned Days' not applied
41 - 'Weeks Between Same Assignment On Same Day Of Week' not applied
42 - 'Weeks Between Same Day Of Week' not applied
43INFO : (02-06 14:06:20) started: Scheduler::Cache::Collector.collect_all
44INFO : (02-06 14:06:20) collect_staffs
45 Staff Load (156.7ms) SELECT DISTINCT `staffs`.* FROM `staffs` INNER JOIN `assign_staff_types` ON `assign_staff_types`.`staff_id` = `staffs`.`id` INNER JOIN `staff_types` ON `staff_types`.`id` = `assign_staff_types`.`staff_type_id` WHERE `staffs`.`client_id` = 319 AND `staffs`.`take_call` = 1 AND `staffs`.`active` = 1 ORDER BY `staffs`.`display_order` ASC, last_name, first_name
46 Client Load (296.0ms) SELECT `clients`.* FROM `clients` WHERE `clients`.`id` = 319
47 StaffSpecialization Load (134.4ms) SELECT `staff_specializations`.* FROM `staff_specializations` WHERE `staff_specializations`.`staff_id` IN (20702, 20705, 20704, 20695, 20701, 20697, 20699, 20698, 20706, 20696)
48 Specialization Load (171.3ms) SELECT `specializations`.* FROM `specializations` WHERE `specializations`.`id` IN (711, 712) ORDER BY `specializations`.`priority` ASC
49 StaffCallType Load (137.1ms) SELECT `staff_call_types`.* FROM `staff_call_types` WHERE `staff_call_types`.`staff_id` IN (20702, 20705, 20704, 20695, 20701, 20697, 20699, 20698, 20706, 20696)
50INFO : (02-06 14:06:23) initial eligibles: [20702,20705,20704,20695,20701,20697,20699,20698,20706,20696]
51INFO : (02-06 14:06:23) collect_call_types
52 CallType Load (137.7ms) SELECT `call_types`.* FROM `call_types` WHERE `call_types`.`client_id` = 319 AND `call_types`.`active` = 1 ORDER BY `call_types`.`display_order` ASC
53INFO : (02-06 14:06:23) initial call types: [12692,12693,12694,12705,12702,12706]
54INFO : (02-06 14:06:23) collect_chain_links
55 ChainLink Load (146.6ms) SELECT `chain_links`.* FROM `chain_links` WHERE `chain_links`.`client_id` = 319
56INFO : (02-06 14:06:23) collect_linkages
57INFO : (02-06 14:06:23) collect_schedules
58 Schedule Load (133.9ms) SELECT `schedules`.* FROM `schedules` WHERE `schedules`.`client_id` = 319 AND (`schedules`.`schedule_on` BETWEEN '2018-03-01' AND '2018-03-31')
59INFO : (02-06 14:06:24) collect_slots
60INFO : (02-06 14:06:24) collect_approved_call_requests
61 Request Load (136.3ms) SELECT `requests`.* FROM `requests` INNER JOIN `staffs` ON `staffs`.`id` = `requests`.`staff_id` WHERE `requests`.`client_id` = 319 AND `requests`.`request_type` = 1 AND `requests`.`status` = 1 AND (`requests`.`schedule_on` BETWEEN '2018-03-01' AND '2018-03-31') ORDER BY requests.schedule_on ASC, staffs.request_priority ASC, requests.created_at ASC
62INFO : (02-06 14:06:24) collect_approved_no_call_requests
63 Request Load (134.2ms) SELECT `requests`.* FROM `requests` WHERE `requests`.`client_id` = 319 AND `requests`.`request_type` = 0 AND `requests`.`status` = 1 AND (`requests`.`schedule_on` BETWEEN '2018-03-01' AND '2018-03-31') ORDER BY requests.schedule_on asc, requests.created_at asc
64INFO : (02-06 14:06:24) finished: Scheduler::Cache::Collector.collect_all
65INFO : (02-06 14:06:24) begin to process requests
66 CallType Load (135.0ms) SELECT `call_types`.* FROM `call_types` WHERE `call_types`.`calendar_schedule_id` = 1381 AND `call_types`.`active` = 1
67 (135.0ms) SELECT MAX(blocks.end_date) FROM `published_blocks` INNER JOIN `blocks` ON `blocks`.`id` = `published_blocks`.`block_id` WHERE `published_blocks`.`calendar_schedule_id` = 1381 AND ((published_blocks.assignment_ids IS NULL) AND (published_blocks.days_of_week_mask = 127))
68 Request Load (135.7ms) SELECT distinct requests.* FROM `requests` INNER JOIN `request_call_types` ON `request_call_types`.`request_id` = `requests`.`id` WHERE `requests`.`client_id` = 319 AND `requests`.`status` = 1 AND `requests`.`request_type` = 1 AND `request_call_types`.`call_type_id` IN (12692, 12693, 12694, 12702, 12705) AND (requests.schedule_on > '2018-02-28')
69 SQL (156.2ms) UPDATE `schedules` SET `schedules`.`populate_method` = 'auto_approved_request', `schedules`.`creator_id` = 166 WHERE `schedules`.`client_id` = 319 AND 1=0
70INFO : (02-06 14:06:26) end of requests processing
71INFO : (02-06 14:06:26) begin to process specializations
72 Block Load (138.3ms) SELECT `blocks`.* FROM `blocks` INNER JOIN `block_schedules` ON `blocks`.`block_schedule_id` = `block_schedules`.`id` WHERE `block_schedules`.`id` = 447 AND (blocks.start_date <= '2018-03-31' AND blocks.end_date >= '2018-03-31') ORDER BY start_date asc, end_date asc LIMIT 1
73 Client Load (277.2ms) SELECT `clients`.* FROM `clients` WHERE `clients`.`id` = 319 LIMIT 1
74 NegativeLink Load (133.3ms) SELECT `negative_links`.* FROM `negative_links` WHERE `negative_links`.`client_id` = 319
75 CallType Load (136.9ms) SELECT `call_types`.* FROM `call_types` INNER JOIN `eligible_call_types` ON `eligible_call_types`.`call_type_id` = `call_types`.`id` WHERE `call_types`.`calendar_schedule_id` = 1381 AND `call_types`.`active` = 1
76INFO : (02-06 14:06:27) <-- clear: 0 - Scheduler::AutoPopulate::Queries::CreateTables
77INFO : (02-06 14:06:27) <-- clear: 1 - Scheduler::AutoPopulate::Queries::AutoPopulateSlots
78INFO : (02-06 14:06:27) <-- clear: 2 - Scheduler::AutoPopulate::Queries::Query003
79INFO : (02-06 14:06:27) <-- clear: 3 - Scheduler::AutoPopulate::Queries::Query005
80INFO : (02-06 14:06:27) <-- clear: 4 - Scheduler::AutoPopulate::Queries::Query01
81INFO : (02-06 14:06:27) <-- clear: 5 - Scheduler::AutoPopulate::Queries::Query012
82INFO : (02-06 14:06:27) <-- clear: 6 - Scheduler::AutoPopulate::Queries::QueryTargets
83INFO : (02-06 14:06:27) <-- clear: 7 - Scheduler::AutoPopulate::Queries::Query013
84INFO : (02-06 14:06:27) <-- clear: 8 - Scheduler::AutoPopulate::Queries::Query014
85INFO : (02-06 14:06:27) <-- clear: 9 - Scheduler::AutoPopulate::Queries::Query015
86INFO : (02-06 14:06:27) <-- clear: 10 - Scheduler::AutoPopulate::Queries::Query02
87INFO : (02-06 14:06:27) <-- clear: 11 - Scheduler::AutoPopulate::Queries::Query03
88INFO : (02-06 14:06:27) <-- clear: 12 - Scheduler::AutoPopulate::Queries::Query04
89INFO : (02-06 14:06:27) <-- clear: 13 - Scheduler::AutoPopulate::Queries::Query045
90INFO : (02-06 14:06:27) <-- clear: 14 - Scheduler::AutoPopulate::Queries::QueryA
91INFO : (02-06 14:06:27) <-- clear: 15 - Scheduler::AutoPopulate::Queries::QueryB
92INFO : (02-06 14:06:27) <-- clear: 16 - Scheduler::AutoPopulate::Queries::Query05
93INFO : (02-06 14:06:27) <-- clear: 17 - Scheduler::AutoPopulate::Queries::Query06
94INFO : (02-06 14:06:27) <-- clear: 18 - Scheduler::AutoPopulate::Queries::Query07
95INFO : (02-06 14:06:27) <-- clear: 19 - Scheduler::AutoPopulate::Queries::Query0702
96INFO : (02-06 14:06:27) <-- clear: 20 - Scheduler::AutoPopulate::Queries::Query0703
97INFO : (02-06 14:06:27) <-- clear: 21 - Scheduler::AutoPopulate::Queries::Query0704
98INFO : (02-06 14:06:27) <-- clear: 22 - Scheduler::AutoPopulate::Queries::Query0705
99INFO : (02-06 14:06:27) <-- clear: 23 - Scheduler::AutoPopulate::Queries::Query0706
100INFO : (02-06 14:06:27) <-- clear: 24 - Scheduler::AutoPopulate::Queries::Query0707
101INFO : (02-06 14:06:27) <-- clear: 25 - Scheduler::AutoPopulate::Queries::Query0708
102INFO : (02-06 14:06:27) <-- clear: 26 - Scheduler::AutoPopulate::Queries::Query0709
103INFO : (02-06 14:06:27) <-- clear: 27 - Scheduler::AutoPopulate::Queries::Query07_10_AL
104INFO : (02-06 14:06:27) <-- clear: 28 - Scheduler::AutoPopulate::Queries::Query07_10_AL_01
105INFO : (02-06 14:06:27) <-- clear: 29 - Scheduler::AutoPopulate::Queries::Query07_10_AL_02
106INFO : (02-06 14:06:27) <-- clear: 30 - Scheduler::AutoPopulate::Queries::Query07_10_AL_03
107INFO : (02-06 14:06:27) <-- clear: 31 - Scheduler::AutoPopulate::Queries::Query07_10_AL_04
108INFO : (02-06 14:06:27) <-- clear: 32 - Scheduler::AutoPopulate::Queries::Query08
109INFO : (02-06 14:06:27) <-- clear: 33 - Scheduler::AutoPopulate::Queries::Query085
110INFO : (02-06 14:06:27) <-- clear: 34 - Scheduler::AutoPopulate::Queries::Query09
111INFO : (02-06 14:06:27) <-- clear: 35 - Scheduler::AutoPopulate::Queries::Query092
112INFO : (02-06 14:06:27) <-- clear: 36 - Scheduler::AutoPopulate::Queries::Query093
113INFO : (02-06 14:06:27) <-- clear: 37 - Scheduler::AutoPopulate::Queries::Query095
114INFO : (02-06 14:06:27) <-- clear: 38 - Scheduler::AutoPopulate::Queries::Query097
115INFO : (02-06 14:06:27) <-- clear: 39 - Scheduler::AutoPopulate::Queries::Query098
116INFO : (02-06 14:06:27) <-- clear: 40 - Scheduler::AutoPopulate::Queries::Query09_09_AL_01
117INFO : (02-06 14:06:27) <-- clear: 41 - Scheduler::AutoPopulate::Queries::Query09_09_AL_02
118INFO : (02-06 14:06:27) <-- clear: 42 - Scheduler::AutoPopulate::Queries::Query09_09_AL_03
119INFO : (02-06 14:06:27) <-- clear: 43 - Scheduler::AutoPopulate::Queries::Query09_09_AL_04
120INFO : (02-06 14:06:27) <-- clear: 44 - Scheduler::AutoPopulate::Queries::Query09_09_RP
121INFO : (02-06 14:06:27) <-- clear: 45 - Scheduler::AutoPopulate::Queries::Query10
122INFO : (02-06 14:06:27) <-- clear: 46 - Scheduler::AutoPopulate::Queries::QueryScore02
123INFO : (02-06 14:06:27) <-- clear: 47 - Scheduler::AutoPopulate::Queries::QueryScore03
124INFO : (02-06 14:06:27) <-- clear: 48 - Scheduler::AutoPopulate::Queries::QueryScore04
125INFO : (02-06 14:06:27) <-- clear: 49 - Scheduler::AutoPopulate::Queries::Query11
126INFO : (02-06 14:06:27) <-- clear: 50 - Scheduler::AutoPopulate::Queries::DropTables
127 (143.6ms) DROP TABLE IF EXISTS buffer_annual_hour_targets_297339312
128 (138.2ms) DROP TABLE IF EXISTS buffer_annual_point_targets_297339312
129 (138.5ms) DROP TABLE IF EXISTS buffer_annual_targets_staff_totals_297339312
130 (136.0ms) DROP TABLE IF EXISTS buffer_auto_populate_slots_297339312
131 (139.6ms) DROP TABLE IF EXISTS buffer_call_days_targets_297339312
132 (135.4ms) DROP TABLE IF EXISTS buffer_call_type_targets_297339312
133 (143.1ms) DROP TABLE IF EXISTS buffer_cumulative_cd_targets_297339312
134 (134.6ms) DROP TABLE IF EXISTS buffer_cumulative_ct_targets_297339312
135 (143.9ms) DROP TABLE IF EXISTS buffer_cumulative_dow_targets_297339312
136 (134.8ms) DROP TABLE IF EXISTS buffer_cumulative_hour_targets_297339312
137 (149.0ms) DROP TABLE IF EXISTS buffer_cumulative_oa_targets_297339312
138 (135.2ms) DROP TABLE IF EXISTS buffer_cumulative_point_targets_297339312
139 (147.0ms) DROP TABLE IF EXISTS buffer_current_cd_targets_297339312
140 (135.3ms) DROP TABLE IF EXISTS buffer_current_ct_targets_297339312
141 (149.9ms) DROP TABLE IF EXISTS buffer_current_dow_targets_297339312
142 (135.2ms) DROP TABLE IF EXISTS buffer_current_hour_targets_297339312
143 (135.4ms) DROP TABLE IF EXISTS buffer_current_oa_targets_297339312
144 (134.5ms) DROP TABLE IF EXISTS buffer_current_point_targets_297339312
145 (135.2ms) DROP TABLE IF EXISTS buffer_day_of_week_targets_297339312
146 (135.5ms) DROP TABLE IF EXISTS buffer_hour_targets_297339312
147 (137.5ms) DROP TABLE IF EXISTS buffer_linkage_call_days_targets_297339312
148 (139.5ms) DROP TABLE IF EXISTS buffer_linkage_call_type_targets_297339312
149 (136.6ms) DROP TABLE IF EXISTS buffer_linkage_targets_297339312
150 (147.6ms) DROP TABLE IF EXISTS buffer_linkage_hour_targets_297339312
151 (136.8ms) DROP TABLE IF EXISTS buffer_linkage_point_targets_297339312
152 (134.6ms) DROP TABLE IF EXISTS buffer_location_privileges_297339312
153 (135.9ms) DROP TABLE IF EXISTS buffer_periods_297339312
154 (135.4ms) DROP TABLE IF EXISTS buffer_point_targets_297339312
155 (136.1ms) DROP TABLE IF EXISTS buffer_schedules_297339312
156 (136.8ms) DROP TABLE IF EXISTS buffer_staff_rotation_points_297339312
157 (135.0ms) DROP TABLE IF EXISTS buffer_target_call_types_297339312
158 (134.9ms) DROP TABLE IF EXISTS buffer_target_daily_points_297339312
159 (144.4ms) DROP TABLE IF EXISTS buffer_target_dates_list_297339312
160 (134.7ms) DROP TABLE IF EXISTS buffer_target_primary_availabilities_297339312
161 (138.8ms) DROP TABLE IF EXISTS buffer_targets_297339312
162 (134.5ms) DROP TABLE IF EXISTS buffer_tmp_targets_availabilities_297339312
163 (139.5ms) DROP TABLE IF EXISTS buffer_tmp_targets_availabilities_exclusions_297339312
164 (135.5ms) DROP TABLE IF EXISTS buffer_tmp_targets_client_totals_297339312
165 (147.1ms) DROP TABLE IF EXISTS buffer_tmp_targets_scheduled_297339312
166 (134.4ms) DROP TABLE IF EXISTS buffer_tmp_targets_staff_totals_297339312
167 (189.1ms) DROP TABLE IF EXISTS buffer_assignment_limit_call_types_297339312
168 (135.1ms) DROP TABLE IF EXISTS buffer_assignment_limit_periods_297339312
169 (135.0ms) DROP TABLE IF EXISTS buffer_assignment_limit_staff_types_297339312
170 (136.3ms) DROP TABLE IF EXISTS buffer_auto_populate_slots_297339312
171 (135.7ms) DROP TABLE IF EXISTS buffer_call_type_assignments_297339312
172 (135.6ms) DROP TABLE IF EXISTS buffer_combined_availabilities_297339312
173 (134.7ms) DROP TABLE IF EXISTS buffer_combined_availability_linkages_297339312
174 (135.1ms) DROP TABLE IF EXISTS buffer_counter_increments_297339312
175 (138.8ms) DROP TABLE IF EXISTS buffer_linkage_assigned_days_297339312
176 (135.2ms) DROP TABLE IF EXISTS buffer_linkage_assignments_count_consecutive_297339312
177 (134.7ms) DROP TABLE IF EXISTS buffer_linkage_assignments_count_periods_297339312
178 (136.5ms) DROP TABLE IF EXISTS buffer_linkage_assignments_count_rolling_297339312
179 (135.2ms) DROP TABLE IF EXISTS buffer_linkage_assignments_count_weeks_297339312
180 (145.6ms) DROP TABLE IF EXISTS buffer_linkage_call_type_assignments_297339312
181 (135.7ms) DROP TABLE IF EXISTS buffer_linkage_dow_targets_297339312
182 (150.3ms) DROP TABLE IF EXISTS buffer_linkage_patterns_297339312
183 (135.4ms) DROP TABLE IF EXISTS buffer_linkages_297339312
184 (134.9ms) DROP TABLE IF EXISTS buffer_location_privileges_297339312
185 (134.6ms) DROP TABLE IF EXISTS buffer_min_distances_297339312
186 (136.1ms) DROP TABLE IF EXISTS buffer_negative_relations_297339312
187 (135.4ms) DROP TABLE IF EXISTS buffer_rule_calc_filters_297339312
188 (135.7ms) DROP TABLE IF EXISTS buffer_rule_calc_schedules_297339312
189 (134.8ms) DROP TABLE IF EXISTS buffer_rule_scores_297339312
190 (134.9ms) DROP TABLE IF EXISTS buffer_rule_scores_with_corrections_297339312
191 (178.9ms) DROP TABLE IF EXISTS buffer_schedule_linkages_297339312
192 (135.7ms) DROP TABLE IF EXISTS buffer_schedules_linkage_patterns_297339312
193 (140.5ms) DROP TABLE IF EXISTS buffer_specialization_daily_counts_297339312
194 (140.1ms) DROP TABLE IF EXISTS buffer_staff_assigned_days_297339312
195 (146.5ms) DROP TABLE IF EXISTS buffer_staff_assignments_count_periods_297339312
196 (135.7ms) DROP TABLE IF EXISTS buffer_staff_assignments_count_rolling_297339312
197 (182.2ms) DROP TABLE IF EXISTS buffer_staff_assignments_count_weeks_297339312
198 (135.2ms) DROP TABLE IF EXISTS buffer_staff_assignments_count_consecutive_297339312
199 (144.2ms) DROP TABLE IF EXISTS buffer_staff_daily_counts_297339312
200 (136.5ms) DROP TABLE IF EXISTS buffer_staff_specializations_297339312
201 (169.0ms) DROP TABLE IF EXISTS buffer_static_availabilities_297339312
202 (134.9ms) DROP TABLE IF EXISTS buffer_target_assignments_297339312
203 (160.9ms) DROP VIEW IF EXISTS buffer_weekly_call_type_targets_297339312
204
205 (136.9ms) DROP VIEW IF EXISTS buffer_current_weekly_ct_targets_297339312
206
207 (167.3ms) DROP VIEW IF EXISTS buffer_cumulative_weekly_ct_targets_297339312
208
209 (137.4ms) DROP VIEW IF EXISTS buffer_weekly_targets_297339312
210
211 (159.6ms) DROP VIEW IF EXISTS buffer_current_weekly_oa_targets_297339312
212
213 (139.1ms) DROP VIEW IF EXISTS buffer_cumulative_weekly_oa_targets_297339312
214
215 (160.2ms) DROP VIEW IF EXISTS buffer_weekly_point_targets_297339312
216
217 (139.4ms) DROP VIEW IF EXISTS buffer_current_weekly_point_targets_297339312
218
219 (194.4ms) DROP VIEW IF EXISTS buffer_cumulative_weekly_point_targets_297339312
220
221 (135.2ms) DROP VIEW IF EXISTS buffer_weekly_hour_targets_297339312
222
223 (135.1ms) DROP VIEW IF EXISTS buffer_current_weekly_hour_targets_297339312
224
225 (135.0ms) DROP VIEW IF EXISTS buffer_cumulative_weekly_hour_targets_297339312
226
227 (149.8ms) delete from buffer_target_dates
228 where session_id = 297339312
229 and client_id = 319
230
231INFO : (02-06 14:06:39) --> fill: 0 - Scheduler::AutoPopulate::Queries::CreateTables
232 (138.7ms) CREATE TABLE IF NOT EXISTS buffer_assignment_limit_call_types_297339312 LIKE buffer_assignment_limit_call_types
233 (140.6ms) CREATE TABLE IF NOT EXISTS buffer_assignment_limit_periods_297339312 LIKE buffer_assignment_limit_periods
234 (138.7ms) CREATE TABLE IF NOT EXISTS buffer_assignment_limit_staff_types_297339312 LIKE buffer_assignment_limit_staff_types
235 (137.8ms) CREATE TABLE IF NOT EXISTS buffer_auto_populate_slots_297339312 LIKE buffer_auto_populate_slots
236 (138.1ms) CREATE TABLE IF NOT EXISTS buffer_call_type_assignments_297339312 LIKE buffer_call_type_assignments
237 (138.8ms) CREATE TABLE IF NOT EXISTS buffer_combined_availabilities_297339312 LIKE buffer_combined_availabilities
238 (137.8ms) CREATE TABLE IF NOT EXISTS buffer_combined_availability_linkages_297339312 LIKE buffer_combined_availability_linkages
239 (140.0ms) CREATE TABLE IF NOT EXISTS buffer_counter_increments_297339312 LIKE buffer_counter_increments
240 (138.2ms) CREATE TABLE IF NOT EXISTS buffer_linkage_assigned_days_297339312 LIKE buffer_linkage_assigned_days
241 (139.7ms) CREATE TABLE IF NOT EXISTS buffer_linkage_assignments_count_consecutive_297339312 LIKE buffer_linkage_assignments_count_consecutive
242 (178.2ms) CREATE TABLE IF NOT EXISTS buffer_linkage_assignments_count_periods_297339312 LIKE buffer_linkage_assignments_count_periods
243 (141.7ms) CREATE TABLE IF NOT EXISTS buffer_linkage_assignments_count_rolling_297339312 LIKE buffer_linkage_assignments_count_rolling
244 (137.2ms) CREATE TABLE IF NOT EXISTS buffer_linkage_assignments_count_weeks_297339312 LIKE buffer_linkage_assignments_count_weeks
245 (137.9ms) CREATE TABLE IF NOT EXISTS buffer_linkage_call_type_assignments_297339312 LIKE buffer_linkage_call_type_assignments
246 (146.0ms) CREATE TABLE IF NOT EXISTS buffer_linkage_dow_targets_297339312 LIKE buffer_linkage_dow_targets
247 (139.3ms) CREATE TABLE IF NOT EXISTS buffer_linkage_patterns_297339312 LIKE buffer_linkage_patterns
248 (140.0ms) CREATE TABLE IF NOT EXISTS buffer_linkages_297339312 LIKE buffer_linkages
249 (138.2ms) CREATE TABLE IF NOT EXISTS buffer_location_privileges_297339312 LIKE buffer_location_privileges
250 (155.4ms) CREATE TABLE IF NOT EXISTS buffer_min_distances_297339312 LIKE buffer_min_distances
251 (138.8ms) CREATE TABLE IF NOT EXISTS buffer_negative_relations_297339312 LIKE buffer_negative_relations
252 (155.2ms) CREATE TABLE IF NOT EXISTS buffer_rule_calc_filters_297339312 LIKE buffer_rule_calc_filters
253 (137.6ms) CREATE TABLE IF NOT EXISTS buffer_rule_calc_schedules_297339312 LIKE buffer_rule_calc_schedules
254 (140.8ms) CREATE TABLE IF NOT EXISTS buffer_rule_scores_297339312 LIKE buffer_rule_scores
255 (144.2ms) CREATE TABLE IF NOT EXISTS buffer_rule_scores_with_corrections_297339312 LIKE buffer_rule_scores_with_corrections
256 (159.6ms) CREATE TABLE IF NOT EXISTS buffer_schedule_linkages_297339312 LIKE buffer_schedule_linkages
257 (137.9ms) CREATE TABLE IF NOT EXISTS buffer_schedules_linkage_patterns_297339312 LIKE buffer_schedules_linkage_patterns
258 (176.7ms) CREATE TABLE IF NOT EXISTS buffer_specialization_daily_counts_297339312 LIKE buffer_specialization_daily_counts
259 (138.5ms) CREATE TABLE IF NOT EXISTS buffer_staff_assigned_days_297339312 LIKE buffer_staff_assigned_days
260 (142.0ms) CREATE TABLE IF NOT EXISTS buffer_staff_assignments_count_periods_297339312 LIKE buffer_staff_assignments_count_periods
261 (137.8ms) CREATE TABLE IF NOT EXISTS buffer_staff_assignments_count_rolling_297339312 LIKE buffer_staff_assignments_count_rolling
262 (140.7ms) CREATE TABLE IF NOT EXISTS buffer_staff_assignments_count_weeks_297339312 LIKE buffer_staff_assignments_count_weeks
263 (138.1ms) CREATE TABLE IF NOT EXISTS buffer_staff_assignments_count_consecutive_297339312 LIKE buffer_staff_assignments_count_consecutive
264 (138.6ms) CREATE TABLE IF NOT EXISTS buffer_staff_daily_counts_297339312 LIKE buffer_staff_daily_counts
265 (141.4ms) CREATE TABLE IF NOT EXISTS buffer_staff_specializations_297339312 LIKE buffer_staff_specializations
266 (140.8ms) CREATE TABLE IF NOT EXISTS buffer_static_availabilities_297339312 LIKE buffer_static_availabilities
267 (154.3ms) CREATE TABLE IF NOT EXISTS buffer_target_assignments_297339312 LIKE buffer_target_assignments
268 (139.7ms) CREATE TABLE IF NOT EXISTS buffer_annual_hour_targets_297339312 LIKE buffer_annual_hour_targets
269 (142.5ms) CREATE TABLE IF NOT EXISTS buffer_annual_point_targets_297339312 LIKE buffer_annual_point_targets
270 (138.6ms) CREATE TABLE IF NOT EXISTS buffer_annual_targets_staff_totals_297339312 LIKE buffer_annual_targets_staff_totals
271 (138.0ms) CREATE TABLE IF NOT EXISTS buffer_auto_populate_slots_297339312 LIKE buffer_auto_populate_slots
272 (138.8ms) CREATE TABLE IF NOT EXISTS buffer_call_days_targets_297339312 LIKE buffer_call_days_targets
273 (162.3ms) CREATE TABLE IF NOT EXISTS buffer_call_type_targets_297339312 LIKE buffer_call_type_targets
274 (138.5ms) CREATE TABLE IF NOT EXISTS buffer_cumulative_cd_targets_297339312 LIKE buffer_cumulative_cd_targets
275 (138.1ms) CREATE TABLE IF NOT EXISTS buffer_cumulative_ct_targets_297339312 LIKE buffer_cumulative_ct_targets
276 (140.9ms) CREATE TABLE IF NOT EXISTS buffer_cumulative_dow_targets_297339312 LIKE buffer_cumulative_dow_targets
277 (162.9ms) CREATE TABLE IF NOT EXISTS buffer_cumulative_hour_targets_297339312 LIKE buffer_cumulative_hour_targets
278 (139.8ms) CREATE TABLE IF NOT EXISTS buffer_cumulative_oa_targets_297339312 LIKE buffer_cumulative_oa_targets
279 (147.7ms) CREATE TABLE IF NOT EXISTS buffer_cumulative_point_targets_297339312 LIKE buffer_cumulative_point_targets
280 (139.0ms) CREATE TABLE IF NOT EXISTS buffer_current_cd_targets_297339312 LIKE buffer_current_cd_targets
281 (159.5ms) CREATE TABLE IF NOT EXISTS buffer_current_ct_targets_297339312 LIKE buffer_current_ct_targets
282 (138.4ms) CREATE TABLE IF NOT EXISTS buffer_current_dow_targets_297339312 LIKE buffer_current_dow_targets
283 (153.7ms) CREATE TABLE IF NOT EXISTS buffer_current_hour_targets_297339312 LIKE buffer_current_hour_targets
284 (138.7ms) CREATE TABLE IF NOT EXISTS buffer_current_oa_targets_297339312 LIKE buffer_current_oa_targets
285 (169.2ms) CREATE TABLE IF NOT EXISTS buffer_current_point_targets_297339312 LIKE buffer_current_point_targets
286 (137.8ms) CREATE TABLE IF NOT EXISTS buffer_day_of_week_targets_297339312 LIKE buffer_day_of_week_targets
287 (161.7ms) CREATE TABLE IF NOT EXISTS buffer_hour_targets_297339312 LIKE buffer_hour_targets
288 (138.9ms) CREATE TABLE IF NOT EXISTS buffer_linkage_call_days_targets_297339312 LIKE buffer_linkage_call_days_targets
289 (147.2ms) CREATE TABLE IF NOT EXISTS buffer_linkage_call_type_targets_297339312 LIKE buffer_linkage_call_type_targets
290 (139.2ms) CREATE TABLE IF NOT EXISTS buffer_linkage_targets_297339312 LIKE buffer_linkage_targets
291 (145.0ms) CREATE TABLE IF NOT EXISTS buffer_linkage_hour_targets_297339312 LIKE buffer_linkage_hour_targets
292 (138.0ms) CREATE TABLE IF NOT EXISTS buffer_linkage_point_targets_297339312 LIKE buffer_linkage_point_targets
293 (134.8ms) CREATE TABLE IF NOT EXISTS buffer_location_privileges_297339312 LIKE buffer_location_privileges
294 (137.6ms) CREATE TABLE IF NOT EXISTS buffer_periods_297339312 LIKE buffer_periods
295 (138.0ms) CREATE TABLE IF NOT EXISTS buffer_point_targets_297339312 LIKE buffer_point_targets
296 (139.1ms) CREATE TABLE IF NOT EXISTS buffer_schedules_297339312 LIKE buffer_schedules
297 (144.3ms) CREATE TABLE IF NOT EXISTS buffer_staff_rotation_points_297339312 LIKE buffer_staff_rotation_points
298 (156.0ms) CREATE TABLE IF NOT EXISTS buffer_target_call_types_297339312 LIKE buffer_target_call_types
299 (143.3ms) CREATE TABLE IF NOT EXISTS buffer_target_daily_points_297339312 LIKE buffer_target_daily_points
300 (142.8ms) CREATE TABLE IF NOT EXISTS buffer_target_dates_list_297339312 LIKE buffer_target_dates_list
301 (139.4ms) CREATE TABLE IF NOT EXISTS buffer_target_primary_availabilities_297339312 LIKE buffer_target_primary_availabilities
302 (140.4ms) CREATE TABLE IF NOT EXISTS buffer_targets_297339312 LIKE buffer_targets
303 (139.7ms) CREATE TABLE IF NOT EXISTS buffer_tmp_targets_availabilities_297339312 LIKE buffer_tmp_targets_availabilities
304 (146.1ms) CREATE TABLE IF NOT EXISTS buffer_tmp_targets_availabilities_exclusions_297339312 LIKE buffer_tmp_targets_availabilities_exclusions
305 (140.2ms) CREATE TABLE IF NOT EXISTS buffer_tmp_targets_client_totals_297339312 LIKE buffer_tmp_targets_client_totals
306 (141.2ms) CREATE TABLE IF NOT EXISTS buffer_tmp_targets_scheduled_297339312 LIKE buffer_tmp_targets_scheduled
307 (138.2ms) CREATE TABLE IF NOT EXISTS buffer_tmp_targets_staff_totals_297339312 LIKE buffer_tmp_targets_staff_totals
308INFO : (02-06 14:06:50) --> fill: 1 - Scheduler::AutoPopulate::Queries::AutoPopulateSlots
309 (137.8ms) select
310 b.start_date,
311 b.end_date,
312 (pb.assignment_ids IS NULL) as fully_published,
313 concat(pbct.assignment_type, '#', pbct.assignment_id) as assignment_uid,
314 pbct.days_of_week_mask
315 from blocks as b
316 inner join published_blocks as pb
317 on pb.block_id = b.id
318 inner join published_block_call_types as pbct
319 on pbct.published_block_id = pb.id
320
321 where b.client_id = 319
322 and pb.calendar_schedule_id = 1381
323 and b.end_date BETWEEN '2018-03-01' AND '2018-03-31'
324
325 AutopopulateExclusion Load (150.9ms) SELECT `autopopulate_exclusions`.* FROM `autopopulate_exclusions` WHERE `autopopulate_exclusions`.`client_id` = 319 AND `autopopulate_exclusions`.`schedule_on` IN ('2018-03-01', '2018-03-02', '2018-03-03', '2018-03-04', '2018-03-05', '2018-03-06', '2018-03-07', '2018-03-08', '2018-03-09', '2018-03-10', '2018-03-11', '2018-03-12', '2018-03-13', '2018-03-14', '2018-03-15', '2018-03-16', '2018-03-17', '2018-03-18', '2018-03-19', '2018-03-20', '2018-03-21', '2018-03-22', '2018-03-23', '2018-03-24', '2018-03-25', '2018-03-26', '2018-03-27', '2018-03-28', '2018-03-29', '2018-03-30', '2018-03-31')
326 (285.8ms) INSERT INTO buffer_auto_populate_slots_297339312
327 (schedule_on, day_of_week_mask, call_type_id, display_order, should_be_populated)
328 VALUES ('2018-03-01', '16', '12692', '0', 1), ('2018-03-01', '16', '12692', '0', 1), ('2018-03-01', '16', '12692', '0', 1), ('2018-03-01', '16', '12692', '0', 1), ('2018-03-01', '16', '12692', '0', 1), ('2018-03-01', '16', '12692', '0', 1), ('2018-03-01', '16', '12693', '1', 1), ('2018-03-01', '16', '12693', '1', 1), ('2018-03-01', '16', '12693', '1', 1), ('2018-03-01', '16', '12693', '1', 1), ('2018-03-01', '16', '12693', '1', 1), ('2018-03-01', '16', '12693', '1', 1), ('2018-03-01', '16', '12694', '3', 1), ('2018-03-01', '16', '12694', '3', 1), ('2018-03-01', '16', '12694', '3', 1), ('2018-03-01', '16', '12694', '3', 1), ('2018-03-01', '16', '12694', '3', 1), ('2018-03-01', '16', '12694', '3', 1), ('2018-03-01', '16', '12702', '10', 1), ('2018-03-02', '32', '12692', '0', 1), ('2018-03-02', '32', '12692', '0', 1), ('2018-03-02', '32', '12692', '0', 1), ('2018-03-02', '32', '12692', '0', 1), ('2018-03-02', '32', '12692', '0', 1), ('2018-03-02', '32', '12692', '0', 1), ('2018-03-02', '32', '12693', '1', 1), ('2018-03-02', '32', '12693', '1', 1), ('2018-03-02', '32', '12693', '1', 1), ('2018-03-02', '32', '12693', '1', 1), ('2018-03-02', '32', '12693', '1', 1), ('2018-03-02', '32', '12693', '1', 1), ('2018-03-02', '32', '12694', '3', 1), ('2018-03-02', '32', '12694', '3', 1), ('2018-03-02', '32', '12694', '3', 1), ('2018-03-02', '32', '12694', '3', 1), ('2018-03-02', '32', '12694', '3', 1), ('2018-03-02', '32', '12694', '3', 1), ('2018-03-02', '32', '12702', '10', 1), ('2018-03-03', '64', '12692', '0', 1), ('2018-03-03', '64', '12692', '0', 1), ('2018-03-03', '64', '12692', '0', 1), ('2018-03-03', '64', '12692', '0', 1), ('2018-03-03', '64', '12692', '0', 1), ('2018-03-03', '64', '12692', '0', 1), ('2018-03-03', '64', '12693', '1', 1), ('2018-03-03', '64', '12693', '1', 1), ('2018-03-03', '64', '12693', '1', 1), ('2018-03-03', '64', '12693', '1', 1), ('2018-03-03', '64', '12693', '1', 1), ('2018-03-03', '64', '12693', '1', 1), ('2018-03-03', '64', '12694', '3', 1), ('2018-03-03', '64', '12694', '3', 1), ('2018-03-03', '64', '12694', '3', 1), ('2018-03-03', '64', '12694', '3', 1), ('2018-03-03', '64', '12694', '3', 1), ('2018-03-03', '64', '12694', '3', 1), ('2018-03-03', '64', '12702', '10', 1), ('2018-03-04', '1', '12692', '0', 1), ('2018-03-04', '1', '12692', '0', 1), ('2018-03-04', '1', '12692', '0', 1), ('2018-03-04', '1', '12692', '0', 1), ('2018-03-04', '1', '12692', '0', 1), ('2018-03-04', '1', '12692', '0', 1), ('2018-03-04', '1', '12693', '1', 1), ('2018-03-04', '1', '12693', '1', 1), ('2018-03-04', '1', '12693', '1', 1), ('2018-03-04', '1', '12693', '1', 1), ('2018-03-04', '1', '12693', '1', 1), ('2018-03-04', '1', '12693', '1', 1), ('2018-03-04', '1', '12694', '3', 1), ('2018-03-04', '1', '12694', '3', 1), ('2018-03-04', '1', '12694', '3', 1), ('2018-03-04', '1', '12694', '3', 1), ('2018-03-04', '1', '12694', '3', 1), ('2018-03-04', '1', '12694', '3', 1), ('2018-03-04', '1', '12702', '10', 1), ('2018-03-05', '2', '12692', '0', 1), ('2018-03-05', '2', '12692', '0', 1), ('2018-03-05', '2', '12692', '0', 1), ('2018-03-05', '2', '12692', '0', 1), ('2018-03-05', '2', '12692', '0', 1), ('2018-03-05', '2', '12692', '0', 1), ('2018-03-05', '2', '12693', '1', 1), ('2018-03-05', '2', '12693', '1', 1), ('2018-03-05', '2', '12693', '1', 1), ('2018-03-05', '2', '12693', '1', 1), ('2018-03-05', '2', '12693', '1', 1), ('2018-03-05', '2', '12693', '1', 1), ('2018-03-05', '2', '12694', '3', 1), ('2018-03-05', '2', '12694', '3', 1), ('2018-03-05', '2', '12694', '3', 1), ('2018-03-05', '2', '12694', '3', 1), ('2018-03-05', '2', '12694', '3', 1), ('2018-03-05', '2', '12694', '3', 1), ('2018-03-05', '2', '12702', '10', 1), ('2018-03-06', '4', '12692', '0', 1), ('2018-03-06', '4', '12692', '0', 1), ('2018-03-06', '4', '12692', '0', 1), ('2018-03-06', '4', '12692', '0', 1), ('2018-03-06', '4', '12692', '0', 1), ('2018-03-06', '4', '12692', '0', 1), ('2018-03-06', '4', '12693', '1', 1), ('2018-03-06', '4', '12693', '1', 1), ('2018-03-06', '4', '12693', '1', 1), ('2018-03-06', '4', '12693', '1', 1), ('2018-03-06', '4', '12693', '1', 1), ('2018-03-06', '4', '12693', '1', 1), ('2018-03-06', '4', '12694', '3', 1), ('2018-03-06', '4', '12694', '3', 1), ('2018-03-06', '4', '12694', '3', 1), ('2018-03-06', '4', '12694', '3', 1), ('2018-03-06', '4', '12694', '3', 1), ('2018-03-06', '4', '12694', '3', 1), ('2018-03-06', '4', '12702', '10', 1), ('2018-03-07', '8', '12692', '0', 1), ('2018-03-07', '8', '12692', '0', 1), ('2018-03-07', '8', '12692', '0', 1), ('2018-03-07', '8', '12692', '0', 1), ('2018-03-07', '8', '12692', '0', 1), ('2018-03-07', '8', '12692', '0', 1), ('2018-03-07', '8', '12693', '1', 1), ('2018-03-07', '8', '12693', '1', 1), ('2018-03-07', '8', '12693', '1', 1), ('2018-03-07', '8', '12693', '1', 1), ('2018-03-07', '8', '12693', '1', 1), ('2018-03-07', '8', '12693', '1', 1), ('2018-03-07', '8', '12694', '3', 1), ('2018-03-07', '8', '12694', '3', 1), ('2018-03-07', '8', '12694', '3', 1), ('2018-03-07', '8', '12694', '3', 1), ('2018-03-07', '8', '12694', '3', 1), ('2018-03-07', '8', '12694', '3', 1), ('2018-03-07', '8', '12702', '10', 1), ('2018-03-08', '16', '12692', '0', 1), ('2018-03-08', '16', '12692', '0', 1), ('2018-03-08', '16', '12692', '0', 1), ('2018-03-08', '16', '12692', '0', 1), ('2018-03-08', '16', '12692', '0', 1), ('2018-03-08', '16', '12692', '0', 1), ('2018-03-08', '16', '12693', '1', 1), ('2018-03-08', '16', '12693', '1', 1), ('2018-03-08', '16', '12693', '1', 1), ('2018-03-08', '16', '12693', '1', 1), ('2018-03-08', '16', '12693', '1', 1), ('2018-03-08', '16', '12693', '1', 1), ('2018-03-08', '16', '12694', '3', 1), ('2018-03-08', '16', '12694', '3', 1), ('2018-03-08', '16', '12694', '3', 1), ('2018-03-08', '16', '12694', '3', 1), ('2018-03-08', '16', '12694', '3', 1), ('2018-03-08', '16', '12694', '3', 1), ('2018-03-08', '16', '12702', '10', 1), ('2018-03-09', '32', '12692', '0', 1), ('2018-03-09', '32', '12692', '0', 1), ('2018-03-09', '32', '12692', '0', 1), ('2018-03-09', '32', '12692', '0', 1), ('2018-03-09', '32', '12692', '0', 1), ('2018-03-09', '32', '12692', '0', 1), ('2018-03-09', '32', '12693', '1', 1), ('2018-03-09', '32', '12693', '1', 1), ('2018-03-09', '32', '12693', '1', 1), ('2018-03-09', '32', '12693', '1', 1), ('2018-03-09', '32', '12693', '1', 1), ('2018-03-09', '32', '12693', '1', 1), ('2018-03-09', '32', '12694', '3', 1), ('2018-03-09', '32', '12694', '3', 1), ('2018-03-09', '32', '12694', '3', 1), ('2018-03-09', '32', '12694', '3', 1), ('2018-03-09', '32', '12694', '3', 1), ('2018-03-09', '32', '12694', '3', 1), ('2018-03-09', '32', '12702', '10', 1), ('2018-03-10', '64', '12692', '0', 1), ('2018-03-10', '64', '12692', '0', 1), ('2018-03-10', '64', '12692', '0', 1), ('2018-03-10', '64', '12692', '0', 1), ('2018-03-10', '64', '12692', '0', 1), ('2018-03-10', '64', '12692', '0', 1), ('2018-03-10', '64', '12693', '1', 1), ('2018-03-10', '64', '12693', '1', 1), ('2018-03-10', '64', '12693', '1', 1), ('2018-03-10', '64', '12693', '1', 1), ('2018-03-10', '64', '12693', '1', 1), ('2018-03-10', '64', '12693', '1', 1), ('2018-03-10', '64', '12694', '3', 1), ('2018-03-10', '64', '12694', '3', 1), ('2018-03-10', '64', '12694', '3', 1), ('2018-03-10', '64', '12694', '3', 1), ('2018-03-10', '64', '12694', '3', 1), ('2018-03-10', '64', '12694', '3', 1), ('2018-03-10', '64', '12702', '10', 1), ('2018-03-11', '1', '12692', '0', 1), ('2018-03-11', '1', '12692', '0', 1), ('2018-03-11', '1', '12692', '0', 1), ('2018-03-11', '1', '12692', '0', 1), ('2018-03-11', '1', '12692', '0', 1), ('2018-03-11', '1', '12692', '0', 1), ('2018-03-11', '1', '12693', '1', 1), ('2018-03-11', '1', '12693', '1', 1), ('2018-03-11', '1', '12693', '1', 1), ('2018-03-11', '1', '12693', '1', 1), ('2018-03-11', '1', '12693', '1', 1), ('2018-03-11', '1', '12693', '1', 1), ('2018-03-11', '1', '12694', '3', 1), ('2018-03-11', '1', '12694', '3', 1), ('2018-03-11', '1', '12694', '3', 1), ('2018-03-11', '1', '12694', '3', 1), ('2018-03-11', '1', '12694', '3', 1), ('2018-03-11', '1', '12694', '3', 1), ('2018-03-11', '1', '12702', '10', 1), ('2018-03-12', '2', '12692', '0', 1), ('2018-03-12', '2', '12692', '0', 1), ('2018-03-12', '2', '12692', '0', 1), ('2018-03-12', '2', '12692', '0', 1), ('2018-03-12', '2', '12692', '0', 1), ('2018-03-12', '2', '12692', '0', 1), ('2018-03-12', '2', '12693', '1', 1), ('2018-03-12', '2', '12693', '1', 1), ('2018-03-12', '2', '12693', '1', 1), ('2018-03-12', '2', '12693', '1', 1), ('2018-03-12', '2', '12693', '1', 1), ('2018-03-12', '2', '12693', '1', 1), ('2018-03-12', '2', '12694', '3', 1), ('2018-03-12', '2', '12694', '3', 1), ('2018-03-12', '2', '12694', '3', 1), ('2018-03-12', '2', '12694', '3', 1), ('2018-03-12', '2', '12694', '3', 1), ('2018-03-12', '2', '12694', '3', 1), ('2018-03-12', '2', '12702', '10', 1), ('2018-03-13', '4', '12692', '0', 1), ('2018-03-13', '4', '12692', '0', 1), ('2018-03-13', '4', '12692', '0', 1), ('2018-03-13', '4', '12692', '0', 1), ('2018-03-13', '4', '12692', '0', 1), ('2018-03-13', '4', '12692', '0', 1), ('2018-03-13', '4', '12693', '1', 1), ('2018-03-13', '4', '12693', '1', 1), ('2018-03-13', '4', '12693', '1', 1), ('2018-03-13', '4', '12693', '1', 1), ('2018-03-13', '4', '12693', '1', 1), ('2018-03-13', '4', '12693', '1', 1), ('2018-03-13', '4', '12694', '3', 1), ('2018-03-13', '4', '12694', '3', 1), ('2018-03-13', '4', '12694', '3', 1), ('2018-03-13', '4', '12694', '3', 1), ('2018-03-13', '4', '12694', '3', 1), ('2018-03-13', '4', '12694', '3', 1), ('2018-03-13', '4', '12702', '10', 1), ('2018-03-14', '8', '12692', '0', 1), ('2018-03-14', '8', '12692', '0', 1), ('2018-03-14', '8', '12692', '0', 1), ('2018-03-14', '8', '12692', '0', 1), ('2018-03-14', '8', '12692', '0', 1), ('2018-03-14', '8', '12692', '0', 1), ('2018-03-14', '8', '12693', '1', 1), ('2018-03-14', '8', '12693', '1', 1), ('2018-03-14', '8', '12693', '1', 1), ('2018-03-14', '8', '12693', '1', 1), ('2018-03-14', '8', '12693', '1', 1), ('2018-03-14', '8', '12693', '1', 1), ('2018-03-14', '8', '12694', '3', 1), ('2018-03-14', '8', '12694', '3', 1), ('2018-03-14', '8', '12694', '3', 1), ('2018-03-14', '8', '12694', '3', 1), ('2018-03-14', '8', '12694', '3', 1), ('2018-03-14', '8', '12694', '3', 1), ('2018-03-14', '8', '12702', '10', 1), ('2018-03-15', '16', '12692', '0', 1), ('2018-03-15', '16', '12692', '0', 1), ('2018-03-15', '16', '12692', '0', 1), ('2018-03-15', '16', '12692', '0', 1), ('2018-03-15', '16', '12692', '0', 1), ('2018-03-15', '16', '12692', '0', 1), ('2018-03-15', '16', '12693', '1', 1), ('2018-03-15', '16', '12693', '1', 1), ('2018-03-15', '16', '12693', '1', 1), ('2018-03-15', '16', '12693', '1', 1), ('2018-03-15', '16', '12693', '1', 1), ('2018-03-15', '16', '12693', '1', 1), ('2018-03-15', '16', '12694', '3', 1), ('2018-03-15', '16', '12694', '3', 1), ('2018-03-15', '16', '12694', '3', 1), ('2018-03-15', '16', '12694', '3', 1), ('2018-03-15', '16', '12694', '3', 1), ('2018-03-15', '16', '12694', '3', 1), ('2018-03-15', '16', '12702', '10', 1), ('2018-03-16', '32', '12692', '0', 1), ('2018-03-16', '32', '12692', '0', 1), ('2018-03-16', '32', '12692', '0', 1), ('2018-03-16', '32', '12692', '0', 1), ('2018-03-16', '32', '12692', '0', 1), ('2018-03-16', '32', '12692', '0', 1), ('2018-03-16', '32', '12693', '1', 1), ('2018-03-16', '32', '12693', '1', 1), ('2018-03-16', '32', '12693', '1', 1), ('2018-03-16', '32', '12693', '1', 1), ('2018-03-16', '32', '12693', '1', 1), ('2018-03-16', '32', '12693', '1', 1), ('2018-03-16', '32', '12694', '3', 1), ('2018-03-16', '32', '12694', '3', 1), ('2018-03-16', '32', '12694', '3', 1), ('2018-03-16', '32', '12694', '3', 1), ('2018-03-16', '32', '12694', '3', 1), ('2018-03-16', '32', '12694', '3', 1), ('2018-03-16', '32', '12702', '10', 1), ('2018-03-17', '64', '12692', '0', 1), ('2018-03-17', '64', '12692', '0', 1), ('2018-03-17', '64', '12692', '0', 1), ('2018-03-17', '64', '12692', '0', 1), ('2018-03-17', '64', '12692', '0', 1), ('2018-03-17', '64', '12692', '0', 1), ('2018-03-17', '64', '12693', '1', 1), ('2018-03-17', '64', '12693', '1', 1), ('2018-03-17', '64', '12693', '1', 1), ('2018-03-17', '64', '12693', '1', 1), ('2018-03-17', '64', '12693', '1', 1), ('2018-03-17', '64', '12693', '1', 1), ('2018-03-17', '64', '12694', '3', 1), ('2018-03-17', '64', '12694', '3', 1), ('2018-03-17', '64', '12694', '3', 1), ('2018-03-17', '64', '12694', '3', 1), ('2018-03-17', '64', '12694', '3', 1), ('2018-03-17', '64', '12694', '3', 1), ('2018-03-17', '64', '12702', '10', 1), ('2018-03-18', '1', '12692', '0', 1), ('2018-03-18', '1', '12692', '0', 1), ('2018-03-18', '1', '12692', '0', 1), ('2018-03-18', '1', '12692', '0', 1), ('2018-03-18', '1', '12692', '0', 1), ('2018-03-18', '1', '12692', '0', 1), ('2018-03-18', '1', '12693', '1', 1), ('2018-03-18', '1', '12693', '1', 1), ('2018-03-18', '1', '12693', '1', 1), ('2018-03-18', '1', '12693', '1', 1), ('2018-03-18', '1', '12693', '1', 1), ('2018-03-18', '1', '12693', '1', 1), ('2018-03-18', '1', '12694', '3', 1), ('2018-03-18', '1', '12694', '3', 1), ('2018-03-18', '1', '12694', '3', 1), ('2018-03-18', '1', '12694', '3', 1), ('2018-03-18', '1', '12694', '3', 1), ('2018-03-18', '1', '12694', '3', 1), ('2018-03-18', '1', '12702', '10', 1), ('2018-03-19', '2', '12692', '0', 1), ('2018-03-19', '2', '12692', '0', 1), ('2018-03-19', '2', '12692', '0', 1), ('2018-03-19', '2', '12692', '0', 1), ('2018-03-19', '2', '12692', '0', 1), ('2018-03-19', '2', '12692', '0', 1), ('2018-03-19', '2', '12693', '1', 1), ('2018-03-19', '2', '12693', '1', 1), ('2018-03-19', '2', '12693', '1', 1), ('2018-03-19', '2', '12693', '1', 1), ('2018-03-19', '2', '12693', '1', 1), ('2018-03-19', '2', '12693', '1', 1), ('2018-03-19', '2', '12694', '3', 1), ('2018-03-19', '2', '12694', '3', 1), ('2018-03-19', '2', '12694', '3', 1), ('2018-03-19', '2', '12694', '3', 1), ('2018-03-19', '2', '12694', '3', 1), ('2018-03-19', '2', '12694', '3', 1), ('2018-03-19', '2', '12702', '10', 1), ('2018-03-20', '4', '12692', '0', 1), ('2018-03-20', '4', '12692', '0', 1), ('2018-03-20', '4', '12692', '0', 1), ('2018-03-20', '4', '12692', '0', 1), ('2018-03-20', '4', '12692', '0', 1), ('2018-03-20', '4', '12692', '0', 1), ('2018-03-20', '4', '12693', '1', 1), ('2018-03-20', '4', '12693', '1', 1), ('2018-03-20', '4', '12693', '1', 1), ('2018-03-20', '4', '12693', '1', 1), ('2018-03-20', '4', '12693', '1', 1), ('2018-03-20', '4', '12693', '1', 1), ('2018-03-20', '4', '12694', '3', 1), ('2018-03-20', '4', '12694', '3', 1), ('2018-03-20', '4', '12694', '3', 1), ('2018-03-20', '4', '12694', '3', 1), ('2018-03-20', '4', '12694', '3', 1), ('2018-03-20', '4', '12694', '3', 1), ('2018-03-20', '4', '12702', '10', 1), ('2018-03-21', '8', '12692', '0', 1), ('2018-03-21', '8', '12692', '0', 1), ('2018-03-21', '8', '12692', '0', 1), ('2018-03-21', '8', '12692', '0', 1), ('2018-03-21', '8', '12692', '0', 1), ('2018-03-21', '8', '12692', '0', 1), ('2018-03-21', '8', '12693', '1', 1), ('2018-03-21', '8', '12693', '1', 1), ('2018-03-21', '8', '12693', '1', 1), ('2018-03-21', '8', '12693', '1', 1), ('2018-03-21', '8', '12693', '1', 1), ('2018-03-21', '8', '12693', '1', 1), ('2018-03-21', '8', '12694', '3', 1), ('2018-03-21', '8', '12694', '3', 1), ('2018-03-21', '8', '12694', '3', 1), ('2018-03-21', '8', '12694', '3', 1), ('2018-03-21', '8', '12694', '3', 1), ('2018-03-21', '8', '12694', '3', 1), ('2018-03-21', '8', '12702', '10', 1), ('2018-03-22', '16', '12692', '0', 1), ('2018-03-22', '16', '12692', '0', 1), ('2018-03-22', '16', '12692', '0', 1), ('2018-03-22', '16', '12692', '0', 1), ('2018-03-22', '16', '12692', '0', 1), ('2018-03-22', '16', '12692', '0', 1), ('2018-03-22', '16', '12693', '1', 1), ('2018-03-22', '16', '12693', '1', 1), ('2018-03-22', '16', '12693', '1', 1), ('2018-03-22', '16', '12693', '1', 1), ('2018-03-22', '16', '12693', '1', 1), ('2018-03-22', '16', '12693', '1', 1), ('2018-03-22', '16', '12694', '3', 1), ('2018-03-22', '16', '12694', '3', 1), ('2018-03-22', '16', '12694', '3', 1), ('2018-03-22', '16', '12694', '3', 1), ('2018-03-22', '16', '12694', '3', 1), ('2018-03-22', '16', '12694', '3', 1), ('2018-03-22', '16', '12702', '10', 1), ('2018-03-23', '32', '12692', '0', 1), ('2018-03-23', '32', '12692', '0', 1), ('2018-03-23', '32', '12692', '0', 1), ('2018-03-23', '32', '12692', '0', 1), ('2018-03-23', '32', '12692', '0', 1), ('2018-03-23', '32', '12692', '0', 1), ('2018-03-23', '32', '12693', '1', 1), ('2018-03-23', '32', '12693', '1', 1), ('2018-03-23', '32', '12693', '1', 1), ('2018-03-23', '32', '12693', '1', 1), ('2018-03-23', '32', '12693', '1', 1), ('2018-03-23', '32', '12693', '1', 1), ('2018-03-23', '32', '12694', '3', 1), ('2018-03-23', '32', '12694', '3', 1), ('2018-03-23', '32', '12694', '3', 1), ('2018-03-23', '32', '12694', '3', 1), ('2018-03-23', '32', '12694', '3', 1), ('2018-03-23', '32', '12694', '3', 1), ('2018-03-23', '32', '12702', '10', 1), ('2018-03-24', '64', '12692', '0', 1), ('2018-03-24', '64', '12692', '0', 1), ('2018-03-24', '64', '12692', '0', 1), ('2018-03-24', '64', '12692', '0', 1), ('2018-03-24', '64', '12692', '0', 1), ('2018-03-24', '64', '12692', '0', 1), ('2018-03-24', '64', '12693', '1', 1), ('2018-03-24', '64', '12693', '1', 1), ('2018-03-24', '64', '12693', '1', 1), ('2018-03-24', '64', '12693', '1', 1), ('2018-03-24', '64', '12693', '1', 1), ('2018-03-24', '64', '12693', '1', 1), ('2018-03-24', '64', '12694', '3', 1), ('2018-03-24', '64', '12694', '3', 1), ('2018-03-24', '64', '12694', '3', 1), ('2018-03-24', '64', '12694', '3', 1), ('2018-03-24', '64', '12694', '3', 1), ('2018-03-24', '64', '12694', '3', 1), ('2018-03-24', '64', '12702', '10', 1), ('2018-03-25', '1', '12692', '0', 1), ('2018-03-25', '1', '12692', '0', 1), ('2018-03-25', '1', '12692', '0', 1), ('2018-03-25', '1', '12692', '0', 1), ('2018-03-25', '1', '12692', '0', 1), ('2018-03-25', '1', '12692', '0', 1), ('2018-03-25', '1', '12693', '1', 1), ('2018-03-25', '1', '12693', '1', 1), ('2018-03-25', '1', '12693', '1', 1), ('2018-03-25', '1', '12693', '1', 1), ('2018-03-25', '1', '12693', '1', 1), ('2018-03-25', '1', '12693', '1', 1), ('2018-03-25', '1', '12694', '3', 1), ('2018-03-25', '1', '12694', '3', 1), ('2018-03-25', '1', '12694', '3', 1), ('2018-03-25', '1', '12694', '3', 1), ('2018-03-25', '1', '12694', '3', 1), ('2018-03-25', '1', '12694', '3', 1), ('2018-03-25', '1', '12702', '10', 1), ('2018-03-26', '2', '12692', '0', 1), ('2018-03-26', '2', '12692', '0', 1), ('2018-03-26', '2', '12692', '0', 1), ('2018-03-26', '2', '12692', '0', 1), ('2018-03-26', '2', '12692', '0', 1), ('2018-03-26', '2', '12692', '0', 1), ('2018-03-26', '2', '12693', '1', 1), ('2018-03-26', '2', '12693', '1', 1), ('2018-03-26', '2', '12693', '1', 1), ('2018-03-26', '2', '12693', '1', 1), ('2018-03-26', '2', '12693', '1', 1), ('2018-03-26', '2', '12693', '1', 1), ('2018-03-26', '2', '12694', '3', 1), ('2018-03-26', '2', '12694', '3', 1), ('2018-03-26', '2', '12694', '3', 1), ('2018-03-26', '2', '12694', '3', 1), ('2018-03-26', '2', '12694', '3', 1), ('2018-03-26', '2', '12694', '3', 1), ('2018-03-26', '2', '12702', '10', 1), ('2018-03-27', '4', '12692', '0', 1), ('2018-03-27', '4', '12692', '0', 1), ('2018-03-27', '4', '12692', '0', 1), ('2018-03-27', '4', '12692', '0', 1), ('2018-03-27', '4', '12692', '0', 1), ('2018-03-27', '4', '12692', '0', 1), ('2018-03-27', '4', '12693', '1', 1), ('2018-03-27', '4', '12693', '1', 1), ('2018-03-27', '4', '12693', '1', 1), ('2018-03-27', '4', '12693', '1', 1), ('2018-03-27', '4', '12693', '1', 1), ('2018-03-27', '4', '12693', '1', 1), ('2018-03-27', '4', '12694', '3', 1), ('2018-03-27', '4', '12694', '3', 1), ('2018-03-27', '4', '12694', '3', 1), ('2018-03-27', '4', '12694', '3', 1), ('2018-03-27', '4', '12694', '3', 1), ('2018-03-27', '4', '12694', '3', 1), ('2018-03-27', '4', '12702', '10', 1), ('2018-03-28', '8', '12692', '0', 1), ('2018-03-28', '8', '12692', '0', 1), ('2018-03-28', '8', '12692', '0', 1), ('2018-03-28', '8', '12692', '0', 1), ('2018-03-28', '8', '12692', '0', 1), ('2018-03-28', '8', '12692', '0', 1), ('2018-03-28', '8', '12693', '1', 1), ('2018-03-28', '8', '12693', '1', 1), ('2018-03-28', '8', '12693', '1', 1), ('2018-03-28', '8', '12693', '1', 1), ('2018-03-28', '8', '12693', '1', 1), ('2018-03-28', '8', '12693', '1', 1), ('2018-03-28', '8', '12694', '3', 1), ('2018-03-28', '8', '12694', '3', 1), ('2018-03-28', '8', '12694', '3', 1), ('2018-03-28', '8', '12694', '3', 1), ('2018-03-28', '8', '12694', '3', 1), ('2018-03-28', '8', '12694', '3', 1), ('2018-03-28', '8', '12702', '10', 1), ('2018-03-29', '16', '12692', '0', 1), ('2018-03-29', '16', '12692', '0', 1), ('2018-03-29', '16', '12692', '0', 1), ('2018-03-29', '16', '12692', '0', 1), ('2018-03-29', '16', '12692', '0', 1), ('2018-03-29', '16', '12692', '0', 1), ('2018-03-29', '16', '12693', '1', 1), ('2018-03-29', '16', '12693', '1', 1), ('2018-03-29', '16', '12693', '1', 1), ('2018-03-29', '16', '12693', '1', 1), ('2018-03-29', '16', '12693', '1', 1), ('2018-03-29', '16', '12693', '1', 1), ('2018-03-29', '16', '12694', '3', 1), ('2018-03-29', '16', '12694', '3', 1), ('2018-03-29', '16', '12694', '3', 1), ('2018-03-29', '16', '12694', '3', 1), ('2018-03-29', '16', '12694', '3', 1), ('2018-03-29', '16', '12694', '3', 1), ('2018-03-29', '16', '12702', '10', 1), ('2018-03-30', '32', '12692', '0', 1), ('2018-03-30', '32', '12692', '0', 1), ('2018-03-30', '32', '12692', '0', 1), ('2018-03-30', '32', '12692', '0', 1), ('2018-03-30', '32', '12692', '0', 1), ('2018-03-30', '32', '12692', '0', 1), ('2018-03-30', '32', '12693', '1', 1), ('2018-03-30', '32', '12693', '1', 1), ('2018-03-30', '32', '12693', '1', 1), ('2018-03-30', '32', '12693', '1', 1), ('2018-03-30', '32', '12693', '1', 1), ('2018-03-30', '32', '12693', '1', 1), ('2018-03-30', '32', '12694', '3', 1), ('2018-03-30', '32', '12694', '3', 1), ('2018-03-30', '32', '12694', '3', 1), ('2018-03-30', '32', '12694', '3', 1), ('2018-03-30', '32', '12694', '3', 1), ('2018-03-30', '32', '12694', '3', 1), ('2018-03-30', '32', '12702', '10', 1), ('2018-03-31', '64', '12692', '0', 1), ('2018-03-31', '64', '12692', '0', 1), ('2018-03-31', '64', '12692', '0', 1), ('2018-03-31', '64', '12692', '0', 1), ('2018-03-31', '64', '12692', '0', 1), ('2018-03-31', '64', '12692', '0', 1), ('2018-03-31', '64', '12693', '1', 1), ('2018-03-31', '64', '12693', '1', 1), ('2018-03-31', '64', '12693', '1', 1), ('2018-03-31', '64', '12693', '1', 1), ('2018-03-31', '64', '12693', '1', 1), ('2018-03-31', '64', '12693', '1', 1), ('2018-03-31', '64', '12694', '3', 1), ('2018-03-31', '64', '12694', '3', 1), ('2018-03-31', '64', '12694', '3', 1), ('2018-03-31', '64', '12694', '3', 1), ('2018-03-31', '64', '12694', '3', 1), ('2018-03-31', '64', '12694', '3', 1), ('2018-03-31', '64', '12702', '10', 1)
329
330INFO : (02-06 14:06:51) --> fill: 2 - Scheduler::AutoPopulate::Queries::Query003
331 (138.6ms) insert into buffer_auto_populate_slots_297339312/* client_id */ (
332 schedule_on,
333 day_of_week_mask,
334 call_type_id,
335 display_order,
336 should_be_populated
337 )
338 select distinct straight_join
339 date_add(
340 auto_populate_slots.schedule_on,
341 interval soft_linkages.offset day
342 ) as schedule_on,
343 (1 << (
344 dayofweek(
345 date_add(
346 auto_populate_slots.schedule_on,
347 interval soft_linkages.offset day
348 )
349 ) - 1
350 )
351 ) as day_of_week_mask,
352 soft_linkages.linked_call_type_id as call_type_id,
353 call_types.display_order,
354 0 as should_be_populated
355 from
356 buffer_auto_populate_slots_297339312/* client_id */ as auto_populate_slots
357 inner join soft_linkages
358 on auto_populate_slots.call_type_id = soft_linkages.call_type_id
359 and auto_populate_slots.day_of_week_mask = soft_linkages.day_of_week_mask
360 left join buffer_auto_populate_slots_297339312/* client_id */ as auto_populate_slots_2
361 on date_add(
362 auto_populate_slots.schedule_on,
363 interval soft_linkages.offset day
364 ) = auto_populate_slots_2.schedule_on
365 and soft_linkages.linked_call_type_id = auto_populate_slots_2.call_type_id
366 inner join call_types
367 on soft_linkages.linked_call_type_id = call_types.id
368 where auto_populate_slots_2.id is null
369 order by null
370
371INFO : (02-06 14:06:51) --> fill: 3 - Scheduler::AutoPopulate::Queries::Query005
372 (242.2ms) insert into buffer_auto_populate_slots_297339312 (
373 schedule_on,
374 day_of_week_mask,
375 call_type_id,
376 display_order,
377 should_be_populated
378 )
379 select distinct straight_join
380 date_add(
381 auto_populate_slots.schedule_on,
382 interval linkage_relations.distance_in_days day
383 ) as schedule_on,
384 (1 << (
385 dayofweek(
386 date_add(
387 auto_populate_slots.schedule_on,
388 interval linkage_relations.distance_in_days day
389 )
390 ) - 1
391 )
392 ) as day_of_week_mask,
393 linkage_relations.linked_call_type_id as call_type_id,
394 call_types.display_order,
395 0 as should_be_populated
396 from
397 buffer_auto_populate_slots_297339312 as auto_populate_slots
398 inner join linkage_relations use index (ix_linkage_relations_composite1)
399 on auto_populate_slots.day_of_week_mask = linkage_relations.day_of_week_mask
400 and auto_populate_slots.call_type_id = linkage_relations.call_type_id
401 left join buffer_auto_populate_slots_297339312 as auto_populate_slots_2 use index (ix_buffer_auto_populate_slots_on_date_and_call)
402 on date_add(
403 auto_populate_slots.schedule_on,
404 interval linkage_relations.distance_in_days day
405 ) = auto_populate_slots_2.schedule_on
406 and linkage_relations.linked_call_type_id = auto_populate_slots_2.call_type_id
407 inner join call_types
408 on linkage_relations.linked_call_type_id = call_types.id
409 where auto_populate_slots_2.id is null
410 order by null
411
412INFO : (02-06 14:06:51) --> fill: 4 - Scheduler::AutoPopulate::Queries::Query01
413 (136.5ms) insert into linkage_relations (
414 client_id,
415 day_of_week_mask,
416 call_type_id,
417 linked_call_type_id,
418 distance_in_days,
419 linkage_template_id
420 )
421 select distinct straight_join
422 319 /* client_id */ as client_id,
423 aps.day_of_week_mask,
424 aps.call_type_id,
425 aps.call_type_id as linked_call_type_id,
426 0 as distance_in_days,
427 ifnull(
428 lr.linkage_template_id,
429 @linkage_template_max := @linkage_template_max + 1
430 ) as linkage_template_id
431 from
432 buffer_auto_populate_slots_297339312/* client_id */ as aps
433 inner join (
434 select @linkage_template_max := count(distinct linkage_template_id) - 1
435 from linkage_relations
436 where client_id = 319 /* client_id */
437 order by null
438 ) as lt
439 on 1 = 1
440 left join linkage_relations as lr use index (ix_linkage_relations_composite1)
441 on aps.day_of_week_mask = lr.day_of_week_mask
442 and aps.call_type_id = lr.call_type_id
443 left join linkage_relations as lr_2 use index (ix_linkage_relations_composite1)
444 on aps.day_of_week_mask = lr_2.day_of_week_mask
445 and aps.call_type_id = lr_2.call_type_id
446 and aps.call_type_id = lr_2.linked_call_type_id
447 and lr_2.distance_in_days = 0
448 where lr_2.id is null
449 order by null
450
451 (188.2ms) insert into buffer_schedules_297339312 (
452 call_type_id,
453 staff_id,
454 schedule_on,
455 day_of_week_mask,
456 display_order,
457 week_number,
458 should_be_evaluated,
459 should_be_populated,
460 linkage_instance_id
461 )
462 select
463 call_type_id,
464 staff_id,
465 schedule_on,
466 day_of_week_mask,
467 display_order,
468 week_number,
469 max(should_be_evaluated) as should_be_evaluated,
470 max(should_be_populated) as should_be_populated,
471 min(linkage_instance_id) as linkage_instance_id
472 from (
473 select straight_join
474 auto_populate_slots_2.call_type_id,
475 schedules.staff_id,
476 auto_populate_slots_2.schedule_on,
477 auto_populate_slots_2.day_of_week_mask,
478 auto_populate_slots_2.display_order,
479 yearweek(
480 auto_populate_slots_2.schedule_on,
481 if(clients.start_of_week = 0, 2, 7)
482 ) as week_number,
483 if(schedules.staff_id is null, 1, 0) as should_be_evaluated,
484 (
485 case
486 when (auto_populate_slots_2.should_be_populated = 1 and schedules.staff_id is null) then 1
487 else 0
488 end
489 ) as should_be_populated,
490 (
491 linkage_relations.linkage_template_id * 1000000 +
492 yearweek(
493 auto_populate_slots.schedule_on,
494 if(clients.start_of_week = 0, 2, 7)
495 )
496 ) as linkage_instance_id
497 from
498 buffer_auto_populate_slots_297339312 as auto_populate_slots
499 inner join clients
500 on clients.id = 319 /* client_id */
501 inner join linkage_relations use index (ix_linkage_relations_composite1)
502 on auto_populate_slots.day_of_week_mask = linkage_relations.day_of_week_mask
503 and auto_populate_slots.call_type_id = linkage_relations.call_type_id
504 inner join buffer_auto_populate_slots_297339312 as auto_populate_slots_2 use index (ix_buffer_auto_populate_slots_on_date_and_call)
505 on date_add(
506 auto_populate_slots.schedule_on,
507 interval linkage_relations.distance_in_days day
508 ) = auto_populate_slots_2.schedule_on
509 and linkage_relations.linked_call_type_id = auto_populate_slots_2.call_type_id
510 left join schedules use index (ix_schedules_call_date)
511 on auto_populate_slots_2.call_type_id = schedules.call_type_id
512 and auto_populate_slots_2.schedule_on = schedules.schedule_on
513 ) as t1
514 group by
515 call_type_id,
516 staff_id,
517 schedule_on,
518 day_of_week_mask,
519 display_order,
520 week_number
521 order by null
522
523INFO : (02-06 14:06:52) --> fill: 5 - Scheduler::AutoPopulate::Queries::Query012
524 (142.8ms) update buffer_schedules_297339312 as sc
525 inner join call_types as ct
526 on sc.call_type_id = ct.id
527 inner join calendar_schedules as cs
528 on ct.calendar_schedule_id = cs.id
529 inner join blocks as b
530 on cs.block_schedule_id = b.block_schedule_id
531 and sc.schedule_on between b.start_date and b.end_date
532 set sc.calendar_schedule_id = cs.id,
533 sc.block_id = b.id
534 where sc.linkage_instance_id >= 0
535
536 BlockSchedule Load (133.6ms) SELECT `block_schedules`.* FROM `block_schedules` WHERE `block_schedules`.`id` = 447 LIMIT 1
537 (138.8ms) insert into buffer_periods_297339312 (
538 calendar_schedule_id, block_schedule_id, period_offset, start_block_display_order, end_block_display_order,
539 start_date, end_date, should_be_populated, should_be_evaluated
540 )
541 select t1.calendar_schedule_id,
542 t1.block_schedule_id,
543 t1.period_offset,
544 t2.start_block_display_order,
545 t2.end_block_display_order,
546 t2.start_date,
547 t2.end_date,
548 t1.should_be_populated,
549 t1.should_be_evaluated
550 from (
551 select sc.calendar_schedule_id,
552 b.block_schedule_id,
553 if (
554 (month(b.start_date) - pt.begin_period) >= 0,
555 year(b.start_date) * 100 + (month(b.start_date) - pt.begin_period) div pt.timeframe_type,
556 (year(b.start_date) - 1) * 100 + (month(b.start_date) + 12 - pt.begin_period) div pt.timeframe_type
557 ) as period_offset,
558 max(sc.should_be_populated) as should_be_populated,
559 max(sc.should_be_evaluated) as should_be_evaluated
560 from (
561 select sc.calendar_schedule_id, sc.block_id,
562 max(ps.should_be_populated) as should_be_populated,
563 max(1) as should_be_evaluated
564 from buffer_schedules_297339312 as sc
565 inner join buffer_auto_populate_slots_297339312 as ps
566 on sc.schedule_on = ps.schedule_on
567 and sc.call_type_id = ps.call_type_id
568 group by sc.calendar_schedule_id, sc.block_id
569 order by null
570 ) as sc
571 inner join blocks as b
572 on sc.block_id = b.id
573 inner join population_timeframes as pt
574 on pt.client_id = 319
575 and pt.timeframe_type = 1
576 group by sc.calendar_schedule_id, b.block_schedule_id, period_offset
577 order by null
578 ) as t1
579 inner join (
580 select b.block_schedule_id,
581 if (
582 (month(b.start_date) - pt.begin_period) >= 0,
583 year(b.start_date) * 100 + (month(b.start_date) - pt.begin_period) div pt.timeframe_type,
584 (year(b.start_date) - 1) * 100 + (month(b.start_date) + 12 - pt.begin_period) div pt.timeframe_type
585 ) as period_offset,
586 min(b.display_order) as start_block_display_order,
587 max(b.display_order) as end_block_display_order,
588 min(b.start_date) as start_date,
589 max(b.end_date) as end_date
590 from blocks as b
591 inner join population_timeframes as pt
592 on pt.client_id = 319
593 and pt.timeframe_type = 1
594 where b.client_id = 319
595 group by b.block_schedule_id, period_offset
596 order by null
597 ) as t2
598 on t1.block_schedule_id = t2.block_schedule_id
599 and t1.period_offset = t2.period_offset
600 order by null
601
602 (135.8ms) update buffer_schedules_297339312 as sc
603 inner join buffer_periods_297339312 as p
604 on sc.calendar_schedule_id = p.calendar_schedule_id
605 and sc.schedule_on between p.start_date and p.end_date
606 set sc.period_offset = p.period_offset
607 where sc.linkage_instance_id >= 0