autotune
autotune copied to clipboard
update recommendations API optimalquery to fetch results
The general strategy involves initially attempting the optimal query; if the sum of duration is not matched and rowscount > optimal query count, then considering an alternative suboptimal query.
optimal query
select * from kruize_results k1_0 where k1_0.experiment_name=? and k1_0.interval_start_time>=? and k1_0.interval_end_time<=? order by k1_0.interval_end_time desc fetch first ? rows only
here interval_start_time = interval_end_time - (LONG_TERM_DURATION_DAYS + THRESHOLD 10 days)
suboptimal query
select * from kruize_results k1_0 where k1_0.experiment_name=? and k1_0.interval_end_time<=? order by k1_0.interval_end_time desc fetch first ? rows only
Row Limit is
(LONG_TERM_DURATION_DAYS * 60) mins / TrialSetting.mesurment_durationMinutes