From: Arnaud Lesauvage <thewild@freesurf.fr>
To: Jens Schipkowski <jens.schipkowski@apus.co.at>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow update with simple query
Date: Wed, 13 Dec 2006 14:38:37 +0100
Message-ID: <4580025D.2040903@freesurf.fr> (raw)
In-Reply-To: <op.tkh10qgw81rjf6@xjens.apus.local>
References: <457FDB1E.6040801@freesurf.fr>
<op.tkhy4jpg81rjf6@xjens.apus.local>
<457FF0CD.4050606@freesurf.fr>
<op.tkh10qgw81rjf6@xjens.apus.local>
Jens Schipkowski a écrit :
> On Wed, 13 Dec 2006 13:23:41 +0100, Arnaud Lesauvage <thewild@freesurf.fr>
>> Why is this query better than the other one ? Because it runs the
>> "(field IN ('some','other') AND field2 = 'Y')" once and then executes
>> the join with the resulting set ?
> True. The Subselect in FROM clause will be executed once and will be
> joined using the condition at where clause. So your condition at t2 is not
> executed for each row in t1(2mio records) but for each row in t2(1k
> records). And the boolean value is already set during update.
OK Jens, thanks for clarifying this.
I thought the planner could guess what to do in such cases.
Regards
--
Arnaud
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-performance@postgresql.org
Cc: thewild@freesurf.fr, jens.schipkowski@apus.co.at
Subject: Re: Slow update with simple query
In-Reply-To: <4580025D.2040903@freesurf.fr>
* 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