Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> What's your opinion about updating only if necessary
Like in this example, I had seen several times is better update only the
necessary
WHEN you have several columns with the values you want to update.
Specially check the redo size.
SQL> UPDATE CUENTASF SET
2 CUF_AUTORIZACIONHOY=0, 3 CUF_DEPOSITOHOY=0, 4 CUF_NRORETHOY=0, 5 CUF_RETIROHOY = 0 6 WHERE NOT CUF_STATUS = 'CE';
147 filas actualizadas.
real: 90
Statistics
0 recursive calls 301 db block gets 171 consistent gets 0 physical reads 68804 redo size 405 bytes sent via SQL*Net to client 664 bytes received via SQL*Net from client 3 SQL*Net roundtrips to/from client 1 sorts (memory) 0 sorts (disk) 147 rows processed
SQL> rollback;
Rollback terminado.
real: 50
SQL> UPDATE CUENTASF SET
2 CUF_AUTORIZACIONHOY=0, 3 CUF_DEPOSITOHOY=0, 4 CUF_NRORETHOY=0, 5 CUF_RETIROHOY = 0 6 WHERE NOT CUF_STATUS = 'CE' AND 7 NOT (CUF_AUTORIZACIONHOY=0 AND CUF_DEPOSITOHOY=0 ANDCUF_NRORETHO
real: 50
Statistics
0 recursive calls 5 db block gets 171 consistent gets 0 physical reads 1056 redo size 405 bytes sent via SQL*Net to client 771 bytes received via SQL*Net from client 3 SQL*Net roundtrips to/from client 1 sorts (memory) 0 sorts (disk) 2 rows processed
SQL> rollback;
Rollback terminado.
real: 10
SQL>
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.htmlReceived on Fri Feb 20 2004 - 09:22:07 CST
-----------------------------------------------------------------
![]() |
![]() |