Limit the size of a database. Rotate the log after this size

Limit the size of a database. Rotate the log after this size

am 20.08.2010 16:55:05 von Guillaume Blanc

--0016e6d644caee9ecc048e427bbb
Content-Type: text/plain; charset=ISO-8859-1

Hello everyone,
I've actually a database (MySAM) which is growing very quickly (1,3Go/hour).
I would like to limit the size of the database but with a log rotation after
the size is reached. Do you know a way to do it ?
I thought of maybe a script who would delete the oldest entry when it reach
a certain size. But i don't know how to write it.

--0016e6d644caee9ecc048e427bbb--

RE: Limit the size of a database. Rotate the log after this size

am 20.08.2010 18:36:29 von Travis Ard

Well, it wouldn't exactly limit the size of your tables, but you may want to
look into creating a partitioned table to store your data. You could define
your partition ranges to store a single day's worth of data or whatever
granularity works best for you. Then, when you need to remove older data,
it will be very easy to simply drop the partition(s) you no longer need.

-Travis

-----Original Message-----
From: Guillaume Blanc [mailto:guillaume.b.blanc@gmail.com]
Sent: Friday, August 20, 2010 8:55 AM
To: mysql@lists.mysql.com
Subject: Limit the size of a database. Rotate the log after this size

Hello everyone,
I've actually a database (MySAM) which is growing very quickly (1,3Go/hour).
I would like to limit the size of the database but with a log rotation after
the size is reached. Do you know a way to do it ?
I thought of maybe a script who would delete the oldest entry when it reach
a certain size. But i don't know how to write it.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org