Re: PhpBB 3.x query review

From: Shelby Cain <alyandon(at)yahoo(dot)com>
To: Jean-Michel Pouré <jm(at)poure(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: PhpBB 3.x query review
Date: 2008-01-07 17:37:45
Message-ID: 270856.4540.qm@web55401.mail.re4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

----- Original Message ----
> From: Jean-Michel Pouré <jm(at)poure(dot)com>
> To: pgsql-general(at)postgresql(dot)org
> Sent: Monday, January 7, 2008 11:06:09 AM
> Subject: [GENERAL] PhpBB 3.x query review
>
>
> I set indexes on ban_email, ban_userid and ban_ip.
> But the query plan is still the same.
>
> Any idea?
>

There is hardly any data in the table (~133 rows per page by my calculation) so the planner is choosing
to do a direct sequential scan instead of using an indirect lookup through an
index because it is faster. Considering the query returned in under 0.1ms I think you may be engaging in premature optimization by adding indexes to this table. If you expect that table to eventually contain many thousands of entries then an index might be prudent.

Regards,

Shelby Cain

____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Browse pgsql-general by date

  From Date Subject
Next Message Shane Ambler 2008-01-07 17:52:47 Re: PhpBB 3.x query review
Previous Message Kevin Hunter 2008-01-07 17:30:50 many to one of many modeling question