[Spce-user] DBCleaner - not using index.
Rene Krenn
rkrenn at sipwise.com
Tue Jun 14 10:55:46 EDT 2016
thanks for pointing, preparing ticket.
>turn suboptimal query
>select id from cdr where from_unixtime(start_time) >= '2016-01-01
>00:00:00' and from_unixtime(start_time) < date_add('2016-01-01
>00:00:00', interval 1 month) limit 10000;
>into something like
>select id from cdr where start_time >= unix_timestamp('2016-01-01
>00:00:00') and start_time < unix_timestamp(date_add('2016-01-01
>00:00:00', interval 1 month)) limit 10000;
>to use exisitng indexes properly.
btw. we will anyway use partition drops for this scenario soon, which
execute instantly.
regards, rene
More information about the Spce-user
mailing list