|
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/ |