Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greg Stark <gsstark@mit.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

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux