From: Bart Degryse <Bart.Degryse@indicator.be>
To: Markus Bertheau <mbertheau.pg@googlemail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Function returns error (view)
Date: Wed, 27 Feb 2008 10:16:51 +0100
Message-ID: <47C53892.A3DD.0030.0@indicator.be> (raw)
In-Reply-To: <684362e10802270109y7d63d656jbdff332274a31456@mail.gmail.com>
References: <6a5e3a6f0802260832k9c1375ap632f8adad0740fa2@mail.gmail.com>
<6a5 e3a6f0802261020o51327bceof4845c47ae1b099d@mail.gmail.com>
<47C524E9.A3DD.003 0.0@indicator.be>
<684362e10802270109y7d63d656jbdff332274a31456@mail.gmail.com>
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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: Bart.Degryse@indicator.be, mbertheau.pg@googlemail.com
Subject: Re: Function returns error (view)
In-Reply-To: <47C53892.A3DD.0030.0@indicator.be>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox