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: queries too slow

RE: queries too slow

From: Jack Silvey <JSilvey_at_XOL.com>
Date: Tue, 11 Jul 2000 09:40:33 -0500
Message-Id: <10555.111666@fatcity.com>


Prakash,

79% is WAY too low. For an OLTP system (small number of rows returned) you should see in the >90% range, and want to see >95% range. >99% is ideal. Get after that DBA! It will help greatly across the board.

Now, about the number of blocks and rows visited for the number of rows returned:

The question we must ask ourselves is why does oracle think it necessary to run through 1.4 million rows to get to the 156 it returns? Especially with a unique index?

Gut instinct tells me that the optimizer is making incorrect choices based on the prescense of the :b7 variable. While using bind variables will reduce parsing, it can also cause incorrect optimizer choices.

I would bet that the optimizer is choosing all the rows where DBSTS = 'A' and then sorting through those rows to find out how many have the sku=:b7 clause.

How many rows in the table have DBSTS = 'A'? If it is 1.4 million, we have our answer.

Jack

-----Original Message-----
From: PK J [mailto:pkj_01_at_yahoo.com]
Sent: Monday, July 10, 2000 10:46 AM
To: Multiple recipients of list ORACLE-L Subject: Re: queries too slow

Thanks to all who replied.
Steve/Stephane, I tried rebuilding indexes and analyzing schema after that, that didn't work. The new execution plan uses 'index range scan' instead of previous 'index unique scan'.
Rajesh, the avg row len is 147 bytes and the total no of blocks used for this table is 9255. Also, the
'rows' information in the tkprof is there, but is
slightly difficult to see because of bad formatting. Jack, the buffer cache hit ratio is 79%, i think it's much less than it should be. I'll ask our dba(i'm a developer) to increase db_block_buffers, but it will still try to read SO much information from data block buffers, which is too much for a small no of rows (157)??

Prakash

The new output from tkprof is following:

UPDATE EC_PRDITM SET DSCR=:b1 || ', ' || :b2 ,PRDITMNAME=:b1 || ', ' || :b2

   || '; ' || :b5 || ', ' || :b6
WHERE
 SKU = :b7 AND DBSTS = 'A'

call     count       cpu    elapsed       disk     
query    current        rows

------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse        1      0.00       0.00          0        
 0          0           0
Execute    156    546.82    1330.06    1437402   
1443835        787         156
Fetch        0      0.00       0.00          0        
 0          0           0

------- ------ -------- ---------- ---------- ---------- ---------- ----------
total      157    546.82    1330.06    1437402   
1443835        787         156

Misses in library cache during parse: 1
Misses in library cache during execute: 1 Optimizer goal: CHOOSE
Parsing user id: 31 (SDOSTLO20) (recursive depth: 1)

Rows Execution Plan



      0  UPDATE STATEMENT   GOAL: CHOOSE
      0   UPDATE OF 'EC_PRDITM'
      0    INDEX   GOAL: ANALYZED (RANGE SCAN) OF

'EC_PRDITM_SKU_UK'
(UNIQUE) ****************************************************************************


Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/
-- 
Author: PK J
  INET: pkj_01_at_yahoo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
Received on Tue Jul 11 2000 - 09:40:33 CDT

Original text of this message

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