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: Best method: Update all fields or only those that have changed

Re: Best method: Update all fields or only those that have changed

From: <xmark.powell_at_eds.com.x>
Date: 3 Apr 2001 12:47:21 GMT
Message-ID: <9acgop$lbm$1@news.netmar.com>

In article <8qjhcts61mtg2pqotj0f0kmdl4uno919lg_at_4ax.com>, Rhugga <rhugga_at_yahoo.com> writes:
>
>
>I have some CGI stuff that interacts with various tables in Oracle,
>(no joins or anything like that). One group of scripts is a contact
>managment system I am developing and it uses a table with
>44 columns. One part of this 'application' will allow the changes
>to be made which will be an UPDATE statement in the script.
>
>What is the best method to do: Only update the fields that were
>changed, or update every field even if it does not change. The
>entire record will be displayed in an HTML form, there they can make
>changes and they will be UPDATE'd back to the database. This script
>will be relatively simple if I just UPDATE every column, but I wanted
>to see what impact this might have on the Oracle side.
>
>I assume only updating the changed fields is the best moethod, but is
>there any harm in updating fields but not actually changing them?
>(There were always be at least one column in the table getting updated
>for real)
>
>I do not necessarily care about generating any extra redo/archive log,
>if that is the case.
>
>As a side note, would updating a field with not actually changing the
>value stored there generate redo?
>
>Thankx,
>CC

Updating only the changed columns is the best approach. For one thing if you update all columns even if they were not changed then you are making Oracle check all indexes for the row even though there is no need. If you have a large number of users using this application the extra work adds up.

Received on Tue Apr 03 2001 - 07:47:21 CDT

Original text of this message

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