Re: [GENERAL] IN clause performance

2007-07-19 Thread Peter Wiersig
On Thu, Jul 19, 2007 at 05:52:30AM -0700, Paul Codler wrote: > Basic query optimization question- does Postgres process > >x IN (y1, y2) > as fast as >(x = y1 OR x = y2) > > in a function? EXPLAIN indicates this. Peter ---(end of broadcast)---

[GENERAL] IN clause performance

2007-07-19 Thread Paul Codler
Basic query optimization question- does Postgres process x IN (y1, y2) as fast as (x = y1 OR x = y2) in a function?

[GENERAL] IN clause performance

2007-07-18 Thread Pg Coder
Basic query optimization question- does Postgres process x IN (y1, y2) as fast as (x = y1 OR x = y2) in a function?

Re: [GENERAL] IN clause in a cursor

2006-11-30 Thread Nik
Nevermind. I used: OPEN test FOR EXECUTE 'SELECT a, b, c FROM tbl WHERE d IN ' values; Nik wrote: > I have a dynamic set of clauses that I would like to use in the cursor. > Is there a way to achieve this using the "IN" clause and a string, or > multiple "OR" clauses coupled with strings. > > Thi

Re: [GENERAL] IN clause

2006-11-28 Thread Martijn van Oosterhout
On Mon, Nov 27, 2006 at 05:24:31PM -0600, Jim Nasby wrote: > In any case, like Oracle, PostgreSQL does not index NULL values (at > least not in btree). Actually, PostgreSQL does store NULL values in an index, otherwise you could never use them for full index scans (think multicolumn indexes). Yo

Re: [GENERAL] IN clause

2006-11-27 Thread Jim Nasby
On Nov 24, 2006, at 9:04 AM, Marcus Engene wrote: There is one other case where I personally find nullable columns a good thing: process_me ish flags. When a row is not supposed to be processed that field is null and when a field is null it wont be in the index [at least on Oracle]. Actually, t

Re: [GENERAL] IN clause

2006-11-24 Thread Richard Broersma Jr
> yes, except I think you meant: > (unknown or false or false) = unknown > > as can be demonstrated by: > > test=# \pset null 'null' > Null display is "null". > test=# select (null or true); > ?column? > -- > t > (1 row) > > test=# select (null or false); > ?column? > -- > nu

Re: [GENERAL] IN clause

2006-11-24 Thread Ragnar
On fös, 2006-11-24 at 10:10 -0800, Richard Broersma Jr wrote: > > That is fine > > but what I was actually expecting is this > > if > > select * from table where col_name in (null, 'a', 'b'); > > > > to return those rows where col_name is null or if it = a or if it is = b > > > > But i think i

Re: [GENERAL] IN clause

2006-11-24 Thread Richard Broersma Jr
> That is fine > but what I was actually expecting is this > if > select * from table where col_name in (null, 'a', 'b'); > > to return those rows where col_name is null or if it = a or if it is = b > > But i think in does not not support null queries , am i right? > that is correct: if col_

Re: [GENERAL] IN clause

2006-11-24 Thread Marcus Engene
D] [mailto:[EMAIL PROTECTED] On Behalf Of Martijn van Oosterhout Sent: Friday, November 24, 2006 7:20 AM To: surabhi.ahuja Cc: A. Kretschmer; pgsql-general@postgresql.org Subject: Re: [GENERAL] IN clause On Fri, Nov 24, 2006 at 05:31:07PM +0530, surabhi.ahuja wrote: That is fine but what I wa

Re: [GENERAL] IN clause

2006-11-24 Thread Brandon Aiken
TECTED] On Behalf Of Martijn van Oosterhout Sent: Friday, November 24, 2006 7:20 AM To: surabhi.ahuja Cc: A. Kretschmer; pgsql-general@postgresql.org Subject: Re: [GENERAL] IN clause On Fri, Nov 24, 2006 at 05:31:07PM +0530, surabhi.ahuja wrote: > That is fine > but what I was actually expect

Re: [GENERAL] IN clause

2006-11-24 Thread Alban Hertroys
surabhi.ahuja wrote: > That is fine > but what I was actually expecting is this > if > select * from table where col_name in (null, 'a', 'b'); > > to return those rows where col_name is null or if it = a or if it is = b > > But i think in does not not support null queries , am i right? Expres

Re: [GENERAL] IN clause

2006-11-24 Thread Martijn van Oosterhout
On Fri, Nov 24, 2006 at 05:31:07PM +0530, surabhi.ahuja wrote: > That is fine > but what I was actually expecting is this > if > select * from table where col_name in (null, 'a', 'b'); > > to return those rows where col_name is null or if it = a or if it is = b > > But i think in does not not

Re: [GENERAL] IN clause

2006-11-24 Thread surabhi.ahuja
__ From: [EMAIL PROTECTED] on behalf of A. Kretschmer Sent: Fri 11/24/2006 2:59 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] IN clause am Fri, dem 24.11.2006, um 14:42:30 +0530 mailte surabhi.ahuja folgendes: > Hi, > > i have a table > and i have the query se

Re: [GENERAL] IN clause

2006-11-24 Thread A. Kretschmer
am Fri, dem 24.11.2006, um 14:42:30 +0530 mailte surabhi.ahuja folgendes: > Hi, > > i have a table > and i have the query select * from table where col_name is null; > > it returns some rows > > now, say i have to implement the same query using the in clause how shold it > be > done? > >

[GENERAL] IN clause

2006-11-24 Thread surabhi.ahuja
Hi, i have a table and i have the query select * from table where col_name is null; it returns some rows now, say i have to implement the same query using the in clause how shold it be done? select * from table where col_name in (null); but it does not return any rows. Can you please