PhpBB 3.x query review - Mailing list pgsql-general

From Jean-Michel Pouré
Subject PhpBB 3.x query review
Date
Msg-id 1199725569.5144.5.camel@debian
Whole thread Raw
Responses Re: PhpBB 3.x query review
Re: PhpBB 3.x query review
List 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


pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: basic questions: Postgres with yum on CentOS 5.1
Next
From: Eric D Nielsen
Date:
Subject: Re: Server doesn't seem to be listening...