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 user_msg where is_read is true;
> explain select * from user_msg where is_read;
> 
> In the 1st case, partial index was used for the first query.

Note that whatever = TRUE is not equivalent to whatever IS TRUE.
The latter will return FALSE if whatever is NULL, while the former will return
NULL in that case.

There are also some limitations on the optimizer recognizing equivalent
varients of an expression. This might cause a problem with the third
select example.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to