[GENERAL] partial index on boolean, problem with v8.0.0rc1

2004-12-13 Thread Igor Shevchenko
Hi all, PostgreSQL v8.0.0rc1, two variants of a user_msg table: create table user_msg ( message_id integer not null references message(id) on update cascade on delete cascade, user_id integer not null, status smallint not null default 0, is_read boolean not null default false, unique

Re: [GENERAL] partial index on boolean, problem with v8.0.0rc1

2004-12-13 Thread Tom Lane
Igor Shevchenko [EMAIL PROTECTED] writes: In both cases, tables are filled with ~10m of rows, is_read is false in the 1st case, and NULL in the 2nd. I did VACUUM FULL ANALYSE after both imports. Here's the problem: in the 2nd case, planner wouldn't choose an index scan using partial index

Re: [GENERAL] partial index on boolean, problem with v8.0.0rc1

2004-12-13 Thread Bruno Wolff III
On Mon, Dec 13, 2004 at 20:18:57 +0200, Igor Shevchenko [EMAIL PROTECTED] wrote: Here's the problem: in the 2nd case, planner wouldn't choose an index scan using partial index on is_read for the following queries: explain select * from user_msg where is_read=true; explain select * from