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: Fine point on rowtype and update

Re: Fine point on rowtype and update

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sat, 21 Aug 2004 11:17:43 +0000 (UTC)
Message-ID: <cg7b0n$41b$1@sparta.btinternet.com>

Since the pl/sql call is turned into an
'update every column' statement you are, indeed, updating the primary key, and every other indexed column for the row.

Of course, you may not be changing the values, so you don't necessarily leave Oracle chasing down indexes to modify index entries, but there are two side-effects:

  1. Even though the value does not change, a primary key update is a cause of the old PK/FK locking problem on the child table. So if you thought your application didn't need an index on the child table - suddenly it does.
  2. Since you are updating every column in the row, the previous (possibly unchanged) values are copied into the undo record, and then into the redo record for the change. Using this technology puts you right back into the "Oracle copies the whole row into the undo" arena. The overhead may be a problem.
-- 
Regards

Jonathan Lewis

http://www.jlcomp.demon.co.uk/faq/ind_faq.html
The Co-operative Oracle Users' FAQ

http://www.jlcomp.demon.co.uk/seminar.html
Optimising Oracle Seminar - schedule updated July 27th




"nullpointer" <null_pointer_at_rediffmail.com> wrote in message
news:c0728f9d.0408192205.4a4dbfb2_at_posting.google.com...

> Just wondering if its a good idea to update using the rowtype
> variable. You might end up updating the primary key.
>
> Any thoughts ??
>
> Dev
Received on Sat Aug 21 2004 - 06:17:43 CDT

Original text of this message

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