On Wed, Feb 20, 2008 at 12:56:54AM -0800, Postgres User wrote:
> a final question: why does this syntax do a seq scan + filter:
> 
> select * from tablea where fielda = fielda   -or-  select * from
> tablea where fielda in (fielda)
> 
> while this syntax results in no filter, seq scan only
> 
> select * from tablea where 1 = 1
> 
> it seems that both where clauses should be ignored by the optimizer-
> or am i missing something

WHERE fielda = fielda will only match non-null rows...

Have a nice day,
-- 
Martijn van Oosterhout   <[EMAIL PROTECTED]>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution 
> inevitable.
>  -- John F Kennedy

Attachment: signature.asc
Description: Digital signature

Reply via email to