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

Home -> Community -> Usenet -> c.d.o.misc -> Re: A question about UPDATE. How smart is oracle

Re: A question about UPDATE. How smart is oracle

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 16 May 2005 17:20:48 -0700
Message-ID: <1116289007.827852@yasure>


Ole Hansen wrote:
> Hi !
>
> A quick question from a danish oracle newbie.
>
> I have 2 tables, and i want to update a field in table t1 with the sum
> of a field in table t2.
>
> The tables are BIG, so therefore i want the statement to be a
> effective as posible.

I would want that if the tables each contained only a single row.
>
> I have made 2 statements, shown below. Which one should i use ?

Quite simply the one that after creating all appropriate indexes, and running dbms_stats, is most efficient of time and resources.

Run EXPLAIN PLAN and/or AUTOTRACE. A DBA where you work will no doubt smile when you ask for help doing this as most DBAs despise developers that don't do this on every SQL statement they write.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Mon May 16 2005 - 19:20:48 CDT

Original text of this message

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