Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Fine point on rowtype and update
In addition...
c) Even though the value does not change, triggers are fired.
Chris
"Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk> wrote in message
news:cg7b0n$41b$1_at_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:
>
> a) 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.
>
> b) 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
>
>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=