PhpBB 3.x query review

From: Jean-Michel Pouré <jm(at)poure(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: PhpBB 3.x query review
Date: 2008-01-07 17:06:09
Message-ID: 1199725569.5144.5.camel@debian
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

explain analyse
SELECT ban_ip, ban_userid, ban_email, ban_exclude, ban_give_reason,
ban_end
FROM phpbb_banlist
WHERE ban_email = '' AND (ban_userid = 100394 OR ban_ip <> '')

Seq Scan on phpbb_banlist (cost=0.00..1.51 rows=13 width=33) (actual
time=0.013..0.026 rows=19 loops=1)
Filter: (((ban_email)::text = ''::text) AND ((ban_userid = 100394) OR
((ban_ip)::text <> ''::text)))
Total runtime: 0.063 ms

I set indexes on ban_email, ban_userid and ban_ip.
But the query plan is still the same.

Any idea?

Kind regards,
Jean-Michel

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric D Nielsen 2008-01-07 17:10:39 Re: Server doesn't seem to be listening...
Previous Message Scott Marlowe 2008-01-07 16:50:32 Re: basic questions: Postgres with yum on CentOS 5.1