Re: Best way to purge old records from a huge table?

2010-06-04 Thread Shawn Green
Brian Dunning wrote: Hey all - I have a table with 12,000,000 records spread over about 6 years. I'm trying to delete all but the last 2 years, but no matter how small of a group I try to delete at a time, it keeps hanging up the server and I eventually have to restart MySQL. The table looks

Re: Best way to purge old records from a huge table?

2010-06-04 Thread Johan De Meersman
;importe quelle diffusion non autorisée ou la copie de ceci > est interdite. Ce message sert à l'information seulement et n'aura pas > n'importe quel effet légalement obligatoire. Étant donné que les email > peuvent facilement être sujets à la manipulation, nous ne pouvons

RE: Best way to purge old records from a huge table?

2010-06-04 Thread Martin Gainty
uvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > From: br...@briandunning.com > Subject: Best way to purge old records from a huge table? > Date: Fri, 4 Jun 2010 08:10:07 -0700 > To: mysql@lists.mysql.com &g

Re: Best way to purge old records from a huge table?

2010-06-04 Thread Krishna Chandra Prajapati
Hi Brian, I would suggest you to use mk-archiver (Maatkit Tools) for this activity. http://www.percona.com/files/presentations/Make_Life_Easier_Maatkit_v2.pdf Regards, Krishna On Fri, Jun 4, 2010 at 8:40 PM, Brian Dunning wrote: > Hey all - > > I have a table with 12,000,000 records spread ove

Re: Best way to purge old records from a huge table?

2010-06-04 Thread Ananda Kumar
dont use a single delete statment. Use a stored proc, loop through and delete record by record and commit for every 10k. In this way, your mysql will not hang and if you replication setup, slave also will not lag behind. regards anandkl On Fri, Jun 4, 2010 at 8:40 PM, Brian Dunning wrote: > Hey

Best way to purge old records from a huge table?

2010-06-04 Thread Brian Dunning
Hey all - I have a table with 12,000,000 records spread over about 6 years. I'm trying to delete all but the last 2 years, but no matter how small of a group I try to delete at a time, it keeps hanging up the server and I eventually have to restart MySQL. The table looks like this: `creation