Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Performance question - Updage with Correlated/Non Correleated Sub Query

Re: Performance question - Updage with Correlated/Non Correleated Sub Query

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: 2000/04/25
Message-ID: <39058EA1.467F@yahoo.com>#1/1

kdc wrote:
>
> Any whay of predicting which will perform better
>
> update table1
> set column_name = 'New Value'
> where
> exists (select pk from table2 where table1.table2_fk = table_2.pk)
>
> update table1
> set column_name = 'New Value'
> where
> table2_fk in (select pk from table2)

You may find updating a join will outperform both...

update (
  select appropriate_cols + prim keys from tableA, tableB   where a.primkey = b.primkey)
set ...

HTH

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk

We are born naked, wet and hungry...then things get worse
Received on Tue Apr 25 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US