Re: [AMaViS-user] Foreign Keys Necessary?

2007-08-31 Thread steeeeeveee
Original-Nachricht > Datum: Tue, 28 Aug 2007 22:37:33 +0200 > Von: "Andrzej Kukula" <[EMAIL PROTECTED]> > An: amavis-user@lists.sourceforge.net > Betreff: Re: [AMaViS-user] Foreign Keys Necessary? > Mark, > > On 8/28/07, Mark Martinec &

Re: [AMaViS-user] Foreign Keys Necessary?

2007-08-29 Thread mouss
Nate wrote: > I've read all the back threads regarding purge performance in the > logging database, specifically in mysql. It seems like a still > pending issue. In our application where we are increasing the rows > in the msgs table by roughly 1million per day, purging the database > creates

Re: [AMaViS-user] Foreign Keys Necessary?

2007-08-28 Thread Mark Martinec
Andrzej, > > DELETE FROM msgs WHERE time_num < UNIX_TIMESTAMP()-14*24*60*60; > > DELETE FROM msgs WHERE time_num < UNIX_TIMESTAMP()-60*60 AND content IS > > NULL; > > For large tables I'd suggest one improvement: > SET @min_time := UNIX_TIMESTAMP()-14*24*60*60; > DELETE FROM msgs WHERE time_num <

Re: [AMaViS-user] Foreign Keys Necessary?

2007-08-28 Thread Andrzej Kukula
Mark, On 8/28/07, Mark Martinec <[EMAIL PROTECTED]> wrote: > Andrzej, > > > > Btw, versions of amavisd prior to 2.4.0 (which started suggesting > > > the use of a foreign key) had the following example in README.sql: > > > > > > DELETE FROM msgs WHERE UNIX_TIMESTAMP()-time_num > 7*24*60*60; > > >

Re: [AMaViS-user] Foreign Keys Necessary?

2007-08-28 Thread Mark Martinec
Andrzej, > > Btw, versions of amavisd prior to 2.4.0 (which started suggesting > > the use of a foreign key) had the following example in README.sql: > > > > DELETE FROM msgs WHERE UNIX_TIMESTAMP()-time_num > 7*24*60*60; > > DELETE FROM msgs WHERE UNIX_TIMESTAMP()-time_num > 60*60 > > AND conten

Re: [AMaViS-user] Foreign Keys Necessary?

2007-08-24 Thread Mark Martinec
Nate, Btw, versions of amavisd prior to 2.4.0 (which started suggesting the use of a foreign key) had the following example in README.sql: DELETE FROM msgs WHERE UNIX_TIMESTAMP()-time_num > 7*24*60*60; DELETE FROM msgs WHERE UNIX_TIMESTAMP()-time_num > 60*60 AND content IS NULL; DELETE quaranti

Re: [AMaViS-user] Foreign Keys Necessary?

2007-08-19 Thread Andrzej Kukula
On 8/19/07, Andrzej Kukula <[EMAIL PROTECTED]> wrote: > Hello, > > On 8/17/07, Nate <[EMAIL PROTECTED]> wrote: > > > > Just for reference, the queray, down from 3 hours > > when using foreign keys.ies I'm doing to clean the database now > > with foreign keys removed in mysql. I believe this is cat

Re: [AMaViS-user] Foreign Keys Necessary?

2007-08-19 Thread Andrzej Kukula
Hello, On 8/17/07, Nate <[EMAIL PROTECTED]> wrote: > > Just for reference, the queray, down from 3 hours > when using foreign keys.ies I'm doing to clean the database now > with foreign keys removed in mysql. I believe this is catching > everything, and taking roughly 7 minutes per d > > # clear

Re: [AMaViS-user] Foreign Keys Necessary?

2007-08-17 Thread Nate
>>A purpose of 'FOREIGN KEY ... ON DELETE RESTRICT' is to keep a database >>tidy, not allowing to remove a record that is still being referenced. >>It may be removed if desired. >> >>A purpose of 'FOREIGN KEY ... ON DELETE CASCADE' is to let deletion >>remove dependent records automatically, along

Re: [AMaViS-user] Foreign Keys Necessary?

2007-08-15 Thread Mark Martinec
Nate, > I've read all the back threads regarding purge performance in the > logging database, specifically in mysql. It seems like a still > pending issue. In our application where we are increasing the rows > in the msgs table by roughly 1million per day, purging the database > creates an *extr

[AMaViS-user] Foreign Keys Necessary?

2007-08-15 Thread Nate
I've read all the back threads regarding purge performance in the logging database, specifically in mysql. It seems like a still pending issue. In our application where we are increasing the rows in the msgs table by roughly 1million per day, purging the database creates an *extreme* load. I