Jonas Eckerman wrote:
> Jakob Hirsch wrote:
> 
>> I don't think SQLite itself is _that_ slow (in fact, I don't think it's
>> slow at all), it's most probably a matter of optimization,
> 
> SQL Lite *can* be very slow at some inserts/updates on some systems
> because of how it handles writes. SQLite creates a temporary file for
> each write operation, and also waits for writes to be safely finished by
> the OS.
> 
> If speed is more important than databse consistency, the SQL command
> 'PRAGMA SYNCHRONOUS=OFF' makes SQLite a *lot* faster. It simply tells
> SQLIte not to wait for every write to be finished.

Yep, I've tried this.

> 
> On a stable system with working backup routines running SQLite with
> 'PRAGMA SYNCHRONOUS=OFF' for bayes makes a lot of sense.
> 
> Is there any easy way to tell SpamAssassins SQL initializatiuon to run
> specific commands directly after opening a database connection?
> Or would it make more sense creating a
> 'Mail::SpamAssassin::BayesStore::SQLite' that does this if told to?

It has been awhile, but I believe you just need to do this at create
time, so you'd only need a proper .sql file that did it.  If you look in
the "Attic" or whatever they call it in subversion, you'll see that
there used to exist SQLite files.

I believe a custom plugin would need to be created to make use of the
transactional capabilities.  However, I've done the work in the past and
discovered it just was not worth it, you were better off sticking with
Berkeley DBD or the MUCH faster SDBM.

That said, that doesn't mean that I wouldn't welcome a contribution from
someone who went off and did the work, so feel free to create the module
and do the testing.  Submit a bug with the code and results attached and
I will strongly consider adding it to the source tree.


> 
> (I'm moving stuff into a SQLite database in a MIMEDefang filter, so I'm
> thinking of trying it out for bayes as well...)
> 
>> If time permits, I'll do a benchmark run, anyway,
> 
> Are there any ready made benchmark scripts for the bayes stuff?

As Matt said you can find it here:
http://wiki.apache.org/spamassassin/BayesBenchmark

The actual benchmark code is here:
http://wiki.apache.org/spamassassin-data/attachments/BayesBenchmark/attachments/benchmark.tar.gz

I think that I've added enough documentation to get you up and running,
but if you have questions, feel free to ask.  Improvements to the
benchmark are also more than welcome.

Thanks
Michael

Reply via email to