http://bugzilla.spamassassin.org/show_bug.cgi?id=3771
------- Additional Comments From [EMAIL PROTECTED] 2004-09-11 03:06 -------
Subject: Re: New: PostgreSQL Specific Bayes Storage Module
On Fri, 10 Sep 2004, [EMAIL PROTECTED] wrote:
> Part of the work involved is chaning the token column in bayes_token from
> char(5) to a bytea type. This means that we have to convert some of the SQL
> calls to use bind_param so that we can specify the proper type, for instance:
> $sth->bind_param(2, $token, { pg_type => DBD::Pg::PG_BYTEA });
>
> This caused the performance to go from impossible (ie I killed it after about
> 15
> hrs on the first operation in my benchmark) to somewhat livable.
Hmm, I wonder if your Pg installations isn't very optimal. Pg ships with a
very weak default configuration, and you have to do quite a bit of
tweaking to get it up to scratch. I can say that I've had a Pg
implementation of bayes go about as fast as a BDB implementation after
tweaking.
> The next part is figuring out how to make it even faster. A few ideas batted
> around are:
>
> 1) Transactions: turn off autocommit and start a transaction when you tie the
> DB
> and commit when you call untie. PostgreSQL apparently works very well in this
> model.
This makes a HUGE difference. DBI now supports begin_tran which should be
transparently ignored for MySQL if it's not supported.
> 2) Some specific PL/pgSQL code for the _put_token method. It's pretty
> complicated and would probably do well to be implemented a little closer to
> the
> database.
>
> Something else to consider, although I can't think of a good way to implement
> is
> a call to vacuum analyze built into the code. I was only able to get sort of
> decent performance after I setup a cronjob to run vacuum analyze once a minute
> on the bayes tables, pretty sad really.
Not sad at all. Running VACUUM in a cron job is standard operating
practise for Pg. (OK, it's a little sad, but everyone does it).
Matt.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.