MySQL Forums
Forum List  »  Newbie

Re: Round Robin by date
Posted by: Rick James
Date: February 07, 2014 07:21PM

An EVENT can run within MySQL, but repeatedly, a la cron.

You API could delete old records before/after it runs other tasks.

Your SELECTs should have a WHERE clause that avoids rows older than 4 months. (This handles the case where the DELETE has not occurred.)

I would consider PARTITIONing the table into weeks, then DROP PARTITION on any PARTITION that is completely older than 4 months. This would leave rows in the table for up to one week extra. I picked "weeks" because that leads to a 'reasonable' number of PARTITIONs, about 20.

Options: ReplyQuote


Subject
Written By
Posted
February 07, 2014 08:10AM
February 07, 2014 11:19AM
Re: Round Robin by date
February 07, 2014 07:21PM
February 12, 2014 03:21AM
February 12, 2014 08:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.