You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2011/03/23 02:33:01 UTC

svn commit: r1084451 - /spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/PgSQL.pm

Author: mmartinec
Date: Wed Mar 23 01:33:01 2011
New Revision: 1084451

URL: http://svn.apache.org/viewvc?rev=1084451&view=rev
Log:
Bug 6444: tok_touch_all update forces full table scan, kills performance.
- Reverting to original tok_touch_all, which consistently runs
slightly faster with PostgreSQL 8.3.14 than the proposed alternative.
This change is just renaming tok_touch_all to tok_touch_all_6444
and tok_touch_all_old to tok_touch_all, keeping both in place in
case we change our mind later based on some future benchmarks.

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/PgSQL.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/PgSQL.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/PgSQL.pm?rev=1084451&r1=1084450&r2=1084451&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/PgSQL.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/PgSQL.pm Wed Mar 23 01:33:01 2011
@@ -640,7 +640,11 @@ do in tok_get_all)
 
 =cut
 
-sub tok_touch_all {  # proposed in bug 6444
+# tok_touch_all as proposed in bug 6444, executes one update for each token;
+# might run faster with some (older?) versions of PostgreSQL
+# (to switch: rename this one to tok_touch_all and stash the other one away)
+#
+sub tok_touch_all_6444 {
   my ($self, $tokens, $atime) = @_;
 
   return 0 unless (defined($self->{_dbh}));
@@ -702,7 +706,11 @@ sub tok_touch_all {  # proposed in bug 6
   return 1;
 }
 
-sub tok_touch_all_old {
+# original tok_touch_all (not the one proposed in bug 6444),
+# executes one update for all token using an IN operator;
+# seems to run faster with PostgreSQL 8.3.14 than the alternative 
+#
+sub tok_touch_all {
   my ($self, $tokens, $atime) = @_;
 
   return 0 unless (defined($self->{_dbh}));