Re: updating a table with the same value

From: Jonathan Lewis <jlewisoracle_at_gmail.com>
Date: Thu, 8 Dec 2022 16:26:34 +0000
Message-ID: <CAGtsp8=v=6TGuDwDLQHNk610P_rXjJoyG-v1+S2uuOixj=4Gsg_at_mail.gmail.com>



That's not a trivial question to answer; the mechanism would be affected by several factors, including the number of indexes that included the column, and the version of Oracle and, in more realistic cases, the distribution of changed and unchanged rows if you have a where clause which selected a subset of the total rows in the table.

Read the following note to get an idea of how Oracle behaves. https://jonathanlewis.wordpress.com/2019/09/08/quiz-night-34/ Counter-intuitively, with your version of Oracle and in the absence of indexes the "no change" update might produce more undo and redo and operate more slowly than the "real change" updated.

Regards
Jonathan Lewis

On Thu, 8 Dec 2022 at 15:29, <ahmed.fikri_at_t-online.de> wrote:

>
> Hello, everyone,
>
> Could someone please tell if following queries produce the same amount of
> REDO/UNDO?
>
> 1) update table foo set status = 0;
> 2) update table foo set status = 1;
>
> In both cases the status for all records is 0.
>
> Are all blocks rewritten in both cases?
>
> I’m using Oracle 19.3
>
> Thanks
> Ahmed
>
>
>
> Gesendet mit der Telekom Mail App
> <http://www.t-online.de/service/redir/emailmobilapp_ios_smartphone_footerlink.htm>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Dec 08 2022 - 17:26:34 CET

Original text of this message