> From: Henrik K <[EMAIL PROTECTED]>
> Reply-To: Amavis Users <[email protected]>
> Date: Tue, 12 Aug 2008 11:08:32 +0300
> To: Amavis Users <[email protected]>
> Subject: Re: [AMaViS-user] Q about bayes_vars/token and id value
> 
> On Tue, Aug 12, 2008 at 03:50:24AM -0400, Michael Scheidell wrote:
>> alter table bayes_token drop primary key;
>> alter table bayes_token modify id int(11) not null default '1';
>> alter table bayes_token add primary key (token);
>> alter table bayes_token drop key bayes_token_idx1;
>> alter table bayes_token drop key bayes_token_idx2;
>> alter table bayes_token add index bayes_token_idx1 (atime);
>> commit;
> 
> Doesn't that mean that now everytime SA searches for Bayes tokens, it needs
> to scan the whole database?

No, it will still try to look for bayes_token id=1 and token=? Or for
expire, atime<?.  Optimization sees only one key (token) and/or atime,
pretends to use where as extra, but, it seriously don't matter.
If id is 1 on every record, and it uses id=? As a key (as before), its going
to select 100% of the records anyway.
I don't think it will help to hack SA just for amavisd-new, and I don't
recommend it except for huge bayes databases (and then I don't know if it
will help too much)


> 
> Because all the clauses are "SELECT * FROM bayes_token WHERE id=? AND
> token=?". Now ofcourse it can't know what id's the table contains? Unless
> MySQL is wise enough to cache that "everything is 1".
> 

Running it on several servers now, ran sa-learn --force-expire.  Looked at a
sa-learn --dump magic before and after, no errors.


-- 
Michael Scheidell, CTO
>|SECNAP Network Security
Winner 2008 Network Products Guide Hot Companies
FreeBSD SpamAssassin Ports maintainer

_________________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.spammertrap.com
_________________________________________________________________________

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to