Hi Michael,
Le 18/03/2014 20:28, Michael Dykman a écrit :
>
> Also, as you currently have it, the expression DATE_SUB(NOW(),
> INTERVAL 24 is going to be executed once for every single candidate
> row. I would suggest you temporarily memoize that like so:
>
> select into DATE_SUB(NOW(), INTERVAL 24 HOUR) INTO @yesterday ;
>
> SELECT * FROM Status WHERE DWProcessed = 0 AND PreviousStatus NOT IN
> ('PENDING', 'ACCEPTED') AND SubscribeDate < @yesterday);
>
Indeed ! it can be a significant performance improvement ;).
Thanks for this .
Regards,
Christophe.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql