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