Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A155447627F for ; Sat, 11 Jan 2003 23:10:52 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id EEBE14761E9 for ; Sat, 11 Jan 2003 23:10:51 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h0C4As5u025122; Sat, 11 Jan 2003 23:10:54 -0500 (EST) To: vernonw@gatewaytech.com Cc: pgsql-performance@postgresql.org Subject: Re: "IN" or "=" and "OR" In-reply-to: References: Comments: In-reply-to Vernon Wu message dated "Sat, 11 Jan 2003 10:51:44 -0800" Date: Sat, 11 Jan 2003 23:10:53 -0500 Message-ID: <25121.1042344653@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/73 X-Sequence-Number: 720 Vernon Wu writes: > Which query statement is better in terms of preformance ? > select ... from table1 where field1 in ('a', 'b', 'c') > select ... from table1 where field1='a' or field1='b' or field1='c' There is no difference, other than the microseconds the parser spends transforming form 1 into form 2 ... regards, tom lane