On Thu, Oct 05, 2006 at 07:18:37AM -0700, Aaron Stone wrote:
> Please post the plan if we replace
> status IN ('0', '1')
> with
> (status = '0' OR status = '1')
> because that would allow us to keep our symbolic constants in the
> source. I am also curious if this performs differently than IN because
> it sure looks the exact same thing ;-)
Unless that field is actually a "char" or char(), you do not want to be
putting the numbers in quotes. At best, it's an additional cast for the
database. At worst, on older versions it won't cast that automatically,
meaning an index on status is useless.
In any case, PostgreSQL handles IN the same as ( ... OR ... OR ... ).
--
Jim C. Nasby, Database Architect [EMAIL PROTECTED]
Give your computer some brain candy! www.distributed.net Team #1828
Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"