Re: [dspam-users] Postgres vs. MySQL

From: Lionel Bouton <lionel-subscription(at)bouton(dot)name>
To: Casey Allen Shobe <cshobe(at)osss(dot)net>
Cc: Clifton Royston <cliftonr(at)tikitechnologies(dot)com>, Evilio del Rio <edelrio(at)cmima(dot)csic(dot)es>, dspam-users(at)networkdweebs(dot)com, pgsql-performance(at)postgresql(dot)org
Subject: Re: [dspam-users] Postgres vs. MySQL
Date: 2004-11-27 10:14:30
Message-ID: 41A85386.8070407@bouton.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Casey Allen Shobe wrote the following on 11/27/04 03:11 :

>I posted about this a couple days ago on dspam-dev...
>
>I am using DSpam with PostgreSQL, and like you discovered the horrible
>performance. The reason is because the default PostgreSQL query planner
>settings determine that a sequence scan will be more efficient than an
>index scan, which is wrong. To correct this behavior, adjust the query
>planner settings for the appropriate table/column with this command:
>
>alter table "dspam_token_data" alter "token" set statistics 200; analyze;
>
>Let me know if it help you. It worked wonders for me.
>
>
>
In tum mode, this could help too (I'm currently testing it) :
CREATE INDEX id_token_data_sumhits ON dspam_token_data ((spam_hits +
innocent_hits));

Indeed each UPDATE on dspam_token_data in TUM is done with :
WHERE ... AND spam_hits + innocent_hits < 50

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Christopher Browne 2004-11-27 18:43:15 Re: [dspam-users] Postgres vs. MySQL
Previous Message Casey Allen Shobe 2004-11-27 02:11:13 Re: [dspam-users] Postgres vs. MySQL