https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6444

--- Comment #11 from Bradley Kieser <[email protected]> 2010-06-10 17:01:18 EDT 
---
(In reply to comment #10)
> Not to forget, the proposal in Bug 4400 (PostgreSQL schema maintains
> unnecessary
> additional index) is also very much worth it!  To summarize it:
> 
>   -- Drop the secondary index
>   drop index bayes_token_idx1;
>   -- Drop the old primary key
>   alter table bayes_token drop constraint bayes_token_pkey;
>   -- Add the goodnew primary key
>   alter table bayes_token add constraint bayes_token_pkey primary key (token,
> id);
> 
> And the Bug 6447 (new feature to bayes autolearning: learn-on-error)
> helps to curtail the growth of a table bayes_tokens.


Mark,

I see from your comments that you are getting bad results from my patch, but
that is not surprising.

Because I forgot to add that you need to create an index as well.

create index bayes_token_idx1 on bayes_token(token);

That is the key to the speed with my patch.

Yes, it does create the string on each for the update, but that is exactly what
it is meant to do. This is to avoid the deadlocks. So it does do the update one
by one.

Can you please re-run the tests with the missing index added? This is what I
have in my database:

\d bayes_token
            Table "public.bayes_token"
   Column   |  Type   |         Modifiers          
------------+---------+----------------------------
 id         | integer | not null default 0
 token      | bytea   | not null default ''::bytea
 spam_count | integer | not null default 0
 ham_count  | integer | not null default 0
 atime      | integer | not null default 0
Indexes:
    "bayes_token_pkey" PRIMARY KEY, btree (id, token)
    "bayes_token_idx1" btree (token)

-- 
Configure bugmail: 
https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to