Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Does primary key structure impact UPDATE performance?

RE: Does primary key structure impact UPDATE performance?

From: Thomas Jeff <jeff.thomas_at_thomson.net>
Date: Mon, 17 May 2004 08:29:06 -0500
Message-ID: <358728A276824E419580403633AABFD0021F6195@INDYSMAIL03.am.thmulti.com>


Thanks Jonathan. However, the datatypes are correct, i.e. dty=12 date, and dty=1
varchar2 for the subsequent columns:
 WHERE SRC_EFF_FROM_DT = :66 AND KEY_ID = :67 AND SOURCE_ID = :68  bind 65: dty=12 mxl=07(07) mal=00 scl=00 pre=00 oacflg=03 oacfl2=0 size=0 offset=8

   bfp=11036b238 bln=07 avl=07 flg=01
   value="1/1/1899 0:0:0"
 bind 66: dty=1 mxl=128(80) mal=00 scl=00 pre=00 oacflg=03 oacfl2=10 size=0 offset=16

   bfp=11036b240 bln=128 avl=28 flg=01
   value="0004021396~0004021396~RG~500"
 bind 67: dty=1 mxl=32(30) mal=00 scl=00 pre=00 oacflg=03 oacfl2=10 size=0 offset=144

   bfp=11036b2c0 bln=32 avl=05 flg=01
   value="SAPR3"

Waleed: No chaining. Thought of that early on.

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org

<mailto:oracle-l-bounce_at_freelists.org> ] On Behalf Of Jonathan Lewis
Sent: Monday, May 17, 2004 7:57 AM
To: oracle-l_at_freelists.org
Subject: Re: Does primary key structure impact UPDATE performance?

Judging by the number of table blocks you read to update a single row, it looks as if your index is not engineered to meet the needs of the update, and is currently doing something along the lines of:

    check 250,000 rows in the index leaf blocks,     and eliminate 249,950 of them, then check 50     rows against the table to find the right one.

If you think the code looks as if it is supplying all the columns of the index, check the types of the incoming bind variables to make sure they match the types of the columns. You may be losing index precision because of a coercion problem.

Regards

Jonathan Lewis

http://www.jlcomp.demon.co.uk <http://www.jlcomp.demon.co.uk>

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

http://www.jlcomp.demon.co.uk/seminar.html
<http://www.jlcomp.demon.co.uk/seminar.html>
Optimising Oracle Seminar - schedule updated May 1st

See if this is easier to read.

-----Original Message-----
From: Thomas Jeff
Sent: Monday, May 17, 2004 6:25 AM
To: 'oracle-l_at_freelists.org'
Subject: RE: Does primary key structure impact UPDATE performance?

Yes, that's one row at a time. There are no other indexes other then the PK
constraint. TA sample from the trace (following the binds) is like this:

WAIT #1: nam='db file sequential read' ela= 146 p1=12 p2=1831 p3=1 WAIT #1: nam='db file sequential read' ela= 136 p1=11 p2=27 p3=1 WAIT #1:

nam='db file sequential read' ela= 165 p1=49 p2=207213 p3=1 WAIT #1:
nam='db file sequential read' ela= 17462 p1=54 p2=20918 p3=1 WAIT #1:
nam='db file sequential read' ela= 147 p1=54 p2=21512 p3=1 WAIT #1:
nam='db file sequential read' ela= 196 p1=12 p2=5854 p3=1 WAIT #1:
nam='db file sequential read' ela= 142 p1=54 p2=20726 p3=1 WAIT #1:
nam='db file sequential read' ela= 142 p1=54 p2=21526 p3=1 WAIT #1:
nam='db file sequential read' ela= 147 p1=12 p2=5901 p3=1 WAIT #1:
nam='db file sequential read' ela= 140 p1=12 p2=5911 p3=1 WAIT #1:
nam='db file sequential read' ela= 153 p1=11 p2=326 p3=1 WAIT #1:
nam='db file sequential read' ela= 148 p1=54 p2=20944 p3=1 WAIT #1:
nam='db file sequential read' ela= 143 p1=54 p2=21969 p3=1 WAIT #1:
nam='db file sequential read' ela= 151 p1=54 p2=20789 p3=1 WAIT #1:
nam='db file sequential read' ela= 144 p1=54 p2=20755 p3=1 WAIT #1:
nam='db file sequential read' ela= 143 p1=12 p2=6052 p3=1 WAIT #1:
nam='db file sequential read' ela= 137 p1=11 p2=415 p3=1 WAIT #1:
nam='db file sequential read' ela= 137 p1=54 p2=425 p3=1 WAIT #1:
nam='db file sequential read' ela= 124 p1=11 p2=426 p3=1 WAIT #1:
nam='db file sequential read' ela= 174 p1=54 p2=18965 p3=1 EXEC
#1:c=1720000,e=1691529,p=20,cr=2371,cu=1,mis=0,r=1,dep=0,og=4,tim=105920 2213148331

If I'm reading this correctly, elapsed time was 1.7 seconds, required 20 PIO's and
2372 LIO's to execute this UPDATE, which updated one row. p1=11/12 is the index, p1=54
is the table. The e, and cu/cr values are typical.



Please see the official ORACLE-L FAQ: http://www.orafaq.com
<http://www.orafaq.com>


To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/

<http://www.freelists.org/archives/oracle-l/>
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
<http://www.freelists.org/help/fom-serve/cache/1.html>
----------------------------------------------------------------- ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: http://www.orafaq.com ---------------------------------------------------------------- To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line. -- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------
Received on Mon May 17 2004 - 08:26:26 CDT

Original text of this message

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