Re: "IN" or "=" and "OR"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: vernonw(at)gatewaytech(dot)com
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: "IN" or "=" and "OR"
Date: 2003-01-12 04:10:53
Message-ID: 25121.1042344653@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Vernon Wu <vernonw(at)gatewaytech(dot)com> 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Charles H. Woloszynski 2003-01-12 15:52:11 Re: join over 12 tables takes 3 secs to plan
Previous Message Neil Conway 2003-01-12 01:03:25 Re: join over 12 tables takes 3 secs to plan