Re: Implementation of UPDATE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Diogo Biazus <diogo(at)ikono(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Implementation of UPDATE
Date: 2002-08-20 18:44:20
Message-ID: 19386.1029869060@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Diogo Biazus <diogo(at)ikono(dot)com(dot)br> writes:
> I was wondering if postgres executes a subquery in an UPDATE clause once
> and use the result (of the subquery) for all the updates.

It should if the subquery is not dependent on any variables of the outer
table. To tell, run EXPLAIN on the query and look to see if you see
"InitPlan" (done once) or "SubPlan" (done each time result is needed).

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2002-08-20 19:41:13 Re: Off-topic: a round of applause for Marc
Previous Message Tom Lane 2002-08-20 18:38:21 Off-topic: a round of applause for Marc