Re: Function returns error (view) - Mailing list pgsql-sql

From Bart Degryse
Subject Re: Function returns error (view)
Date
Msg-id 47C53892.A3DD.0030.0@indicator.be
Whole thread Raw
In response to Re: Function returns error (view)  ("Markus Bertheau" <mbertheau.pg@googlemail.com>)
Responses Re: Function returns error (view)  ("Markus Bertheau" <mbertheau.pg@googlemail.com>)
List pgsql-sql
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.pg@googlemail.com> 2008-02-27 10:09 >>>
2008/2/27, Bart Degryse <Bart.Degryse@indicator.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/

pgsql-sql by date:

Previous
From: "Markus Bertheau"
Date:
Subject: Re: Function returns error (view)
Next
From: "Stefan Scheidegger"
Date:
Subject: REFERENCES and INHERITS restrictions?