Skip site navigation (1) Skip section navigation (2)

Re: planer don't use index. bad plan for where id = x or id in (select ...)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: planer don't use index. bad plan for where id = x or id in (select ...)
Date: 2004-05-26 16:27:47
Message-ID: 8712.1085588867@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-general
Greg Stark <gsstark(at)mit(dot)edu> writes:
> ... And you can use UNION ALL instead of UNION
> since the IN will eliminate duplicates anyways. This avoids an extra
> sort/uniquify step.

FWIW, CVS tip realizes that it doesn't need two unique-ification steps
in this scenario.  But I agree that UNION ALL is the cleaner way to
write the query.

			regards, tom lane

In response to

pgsql-general by date

Next:From: Matt Van MaterDate: 2004-05-26 16:34:05
Subject: Re: [HACKERS] COPY formatting
Previous:From: Bill MontgomeryDate: 2004-05-26 16:25:45
Subject: Re: [GENERAL] performance very slow

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group