Re: Slow update with simple query

From: Arnaud Lesauvage <thewild(at)freesurf(dot)fr>
To: Jens Schipkowski <jens(dot)schipkowski(at)apus(dot)co(dot)at>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow update with simple query
Date: 2006-12-13 13:38:37
Message-ID: 4580025D.2040903@freesurf.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jens Schipkowski a écrit :
> On Wed, 13 Dec 2006 13:23:41 +0100, Arnaud Lesauvage <thewild(at)freesurf(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Ragnar 2006-12-13 14:49:00 Re: Slow update with simple query
Previous Message Jens Schipkowski 2006-12-13 13:20:40 Re: Slow update with simple query