Q:

How to fix a table size in MySQL?

Is there a way or an option available in MySQL to fix the size of a table? Which will work as a circular buffer and overwrites the old data whenever a new data gets inserted. This is useful when an application is collecting the stats and a month old data becomes no longer useful.
I know programmatically this is possible but I don't want to do that, hence this request.
BTW, this is similar to a feature called capped collection in MongoDb.

A:

If you want to throw away last month's data, just use the day-of-the-month in your primary key.  Last month's "26" will be overwritten by next month's "26".

