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

--- Comment #13 from Mark Martinec <[email protected]> 2010-06-10 17:35:25 
EDT ---
> I forgot, when I submitted the patch, to include the crucial index that is
> needed as well: 
>     create index bayes_token_idx1 on bayes_token(token);

I had this index in my tests, it was as specified in the docs
(sql/bayes_pg.sql).

Actually I tried both ways: with bayes_token_idx1 and a primary
key on (id,token), and then also without the bayes_token_idx1 and
a primary key on (token,id), as suggested in Bug 4400.

It made no difference on tok_touch_all, but the Bug 4400 suggestion
made a little improvement in tok_get_all.

Both the tok_touch_all and the tok_get_all were as reported by the
timing log (added by my patch). It can be seen in the debug log
with area 'timing', e.g.: spamassassin -D timing -t <test.msg
or added as a header field to a message:
  add_header all Timing _TIMING_

Here are my complete results (the comment 7 just summarized it).
The "old index" implies bayes_token_idx1 as per SA docs,
the "new index" implies the Bug 4400 suggestion. The message
was always the same, but the $atime was faked to always use a
current time, so that tokens were always considered new and
had to be updated.


dbg: bayes: tok_get_all: token count: 3454
dbg: bayes: tok_touch_all: rows=151

old index, original tok_touch_all:
  tok_get_all: 153, tok_touch_all: 33
  tok_get_all: 127, tok_touch_all: 16
  tok_get_all: 115, tok_touch_all:  7
  tok_get_all: 112, tok_touch_all:  7

old index, new(Mark) tok_touch_all:
  tok_get_all:  97, tok_touch_all: 35
  tok_get_all: 124, tok_touch_all: 40
  tok_get_all: 147, tok_touch_all: 68
  tok_get_all: 141, tok_touch_all: 42

old index, new(Bradley) tok_touch_all:
  tok_get_all: 103, tok_touch_all: 413
  tok_get_all: 110, tok_touch_all: 330
  tok_get_all:  96, tok_touch_all: 253
  tok_get_all: 113, tok_touch_all: 525

new index, original tok_touch_all:
  tok_get_all: 197, tok_touch_all: 21
  tok_get_all:  99, tok_touch_all: 19
  tok_get_all: 117, tok_touch_all: 12
  tok_get_all:  97, tok_touch_all:  6
  tok_get_all: 116, tok_touch_all: 12
  tok_get_all: 165, tok_touch_all:  6
  tok_get_all:  98, tok_touch_all: 29

new index, new(Mark) tok_touch_all:
  tok_get_all:  95, tok_touch_all: 33
  tok_get_all:  95, tok_touch_all: 39
  tok_get_all:  96, tok_touch_all: 48
  tok_get_all: 103, tok_touch_all: 33

new index, new(Bradley) tok_touch_all:
  tok_get_all: 111, tok_touch_all: 579
  tok_get_all: 103, tok_touch_all: 248
  tok_get_all: 112, tok_touch_all: 329
  tok_get_all: 101, tok_touch_all: 753

-- 
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