On Jan 7, 2008 11:06 AM, Jean-Michel Pouré <jm@poure.com> wrote:
> Dear friends,
>
> I am reviewing some of PhpBB 3.x queries.
> This allows me to learn more about PostgreSQL.
>
> The thread can be read here:
> http://area51.phpbb.com/phpBB/viewtopic.php?f=3&t=29260
>
> Do not hesitate to post your review there.
>
> In pg_tables, I saw that there was an extensive use of sequential scans
> in phpbb_banlist, a small table of 60 rows.
What makes you think a seq scan is bad here? Have you compare the
output of explain analyze of the select with enable_seqscan on and
off? I'm willing to bet seqscan is a win here. 60 rows probably fits
in one page, maybe two or three. I can't imagine the random access of
a index lookups beating sequentially scanning a few pages of data.