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

             Bug #: 6710
           Summary: sa-learn --restore with MySQL is horrible slow
           Product: Spamassassin
           Version: 3.3.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Learner
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


Doing sa-learn --backup / --restore with DBM and a bayes DB of about 9 and 25MB
is pretty fast (around a minute or so IIRC).
Restoring a backup of those DBM files into a MySQL db by using the MySQL module
is horrible slow.
I don't know if the basic SQL module behaves similar.
restore is running now for over 2hrs and while attaching a strace to the
process I noticed its doing every token separate.

Wouldn't it make sense to create an array/buffer to insert N tokens at once?

<snip>
write(4, "\200\0\0\0\3INSERT INTO bayes_seen (id, msgid, flag)\n            
VALUES ('14','63494b63ad4d346fe268b554d485e8a39c8c97e7@sa_generated','s')",
132) = 132
read(4, "\7\0\0\1\0\1\0\1\0\0\0", 16384) = 11
poll([{fd=4, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(4, "\7\0\0\0\3commit", 11)        = 11
read(4, "\7\0\0\1\0\0\0\0\0\0\0", 16384) = 11
</snip>

Not sure if that is related at all but anyway:
I use 3.3.2 with the patches of bug 6624, bug 6625 and bug 6626.

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