Search Postgresql Archives

Re: Regex query not using index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux