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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Function returns error (view)



For rather "simple" queries like this one PostgreSQL indeed seems to be quite smart.
I have quite a lot of statements where it does make a difference though (PostgreSQL 8.2.4).
As long as I have one statement where it makes a difference I will use the join
rather than the IN(subselect) just to be sure of optimal performance.
Keeping that in mind I don't see any harm in advising others to do so too.
But you're right in stating that it's not always necessary.


>>> "Markus Bertheau" <mbertheau(dot)pg(at)googlemail(dot)com> 2008-02-27 10:09 >>>
2008/2/27, Bart Degryse <Bart(dot)Degryse(at)indicator(dot)be>:
>
> I would also suggest you replace the
> ...t.cod_user IN (subselect)
> by a join construction. I think it's more performant.

In recent versions PostgreSQL is quite smart when planning IN, so that
shouldn't be a concern.

Markus

--
Markus Bertheau
Blog: http://www.bluetwanger.de/blog/


Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group