Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

Free Oracle Tips

HTML Text

 Home
 E-mail Us
 Oracle Articles



 Oracle Training
 Oracle News

 Oracle Forum
 Class Catalog


 Our Staff
 Our Prices
 Help Wanted!

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 UNIX
 Oracle UNIX
 Linux
 Oracle Linux
 Monitoring
 Remote help

 Remote plans
 Remote
services
 Oracle C++
 Oracle Java
 Apache
 JDeveloper
 App Server

 Applications
 Oracle Forms
 Oracle Portal
 11i Upgrades
 SQL Server
 Oracle Concepts
 HTML-DB Tips
 Software Help

 Remote Help  
 Development  

 Implementation


 Financials Training
 Oracle 11i
 Oracle Apps 11i
 Oracle Workflow
 Oracle AR 11i Class
 Oracle AP 11i class
 Oracle GL 11i class
 Oracle HR 11i class
 Oracle FA 11i class
 11i Project Mgt
 11i procurement
 11i collections


 Oracle Posters
 Oracle Books

 Oracle Tuning Book
 Oracle RAC Book
 Oracle Security
 Easy Oracle Books
 Oracle Scripts
 SQL Server DBA
 SQL Design Patterns
 WISE
 Excel-DB   


 BC Oracle News


 Rednecks!
 Dress code
 Arabian Stallion

 Burleson Arabians
 Guide Horses
 Don Burleson Blog
 Golf & Travel


 Privacy Policy
 

 

 

 
 

Reduce Oracle Index I/O

Oracle Tips by Burleson Consulting
May 2, 2003

 

By Robin Schumacher

You can use the large (16k or 32K) blocksize data caches to contain data from indexes or tables that are the object of repeated large scans.  Does such a thing really help performance?  A small but revealing test can answer that question.  

For the test, the following query will be used against a 9i database that has a database block size of 8K, but also has the 16K cache enabled along with a 16K tablespace:

select 
      count(*) 
from  
      eradmin.admission
where 
      patient_id between 1 and 40000;

The ERADMIN.ADMISSION table has 150,000 rows in it and has an index build on the PATIENT_ID column.  An EXPLAIN of the query reveals that it uses an index fast-full scan (a multi-block read) to produce the desired end result:

Execution Plan
----------------------------------------------------------
0     SELECT STATEMENT Optimizer=CHOOSE 
1     (Cost=41 Card=1 Bytes=4)
1    0   SORT (AGGREGATE)
2    1     INDEX (FAST FULL SCAN) OF 'ADMISSION_PATIENT_ID' 
              (NON-UNIQUE) (Cost=41 Card=120002 Bytes=480008)

Executing the query (twice to eliminate parse activity and to cache any data) with the index residing in a standard 8K tablespace produces these runtime statistics:

Statistics
---------------------------------------------------
          0  recursive calls
          0  db block gets
        421  consistent gets
          0  physical reads
          0  redo size
        371  bytes sent via SQL*Net to client
        430  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed

To test the effectiveness of the new 16K cache and 16K tablespace, the index used by the query will be rebuilt into the 16K tablespace that has the exact same characteristics as the original 8K tablespace, except for the larger blocksize:

alter index 
      eradmin.admission_patient_id 
      rebuild nologging noreverse tablespace indx_16k;
Once the index is nestled firmly into the 16K tablespace, the 
query is re-executed (again twice)with the following runtime statistics 
being produced:
Statistics
---------------------------------------------------
          0  recursive calls
          0  db block gets
        211  consistent gets
          0  physical reads
          0  redo size
        371  bytes sent via SQL*Net to client
        430  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed

As you can see, the amount of logical reads has been reduced in half simply by using the new 16K tablespace and accompanying 16K data cache.  Clearly, the benefits of properly using the new data caches and multi-block tablespace feature of Oracle9i and above are worth your investigation and trials in your own database. 


Not everyone agrees:

See these notes on the2007 consensus on multiple blocksizes.


Positive experiences:

"My favourite recent article was on 32KB indexes - Our client (200GB+) saw a 20% reduction in I/O from this simple change... " 

The server had 8 CPUs 32gb RAM with db_cache_size = 3g and db_32k_cache_size = 500mb. The database was over 200 gigabytes.

Steve Taylor
Technical Services Manager EMEA
Eagle Investment Systems Corp.

Dissenting opinion:

As Robin demonstrated in his example, the consistent reads are cut in half (340 for 8k block index, 172 for 16k block index). Lets evaluate the performance numbers. The trace file shows that the 16k block index scan ran in 0.04 seconds where the 8k block index scan ran in 0.03. It might appear that the 8k block index is actually faster, but if we look at the raw trace, its basically a rounding issue: TKPROF only reports seconds to two decimal places. Calculating the times from the raw trace we get 0.043023 seconds vs. 0.039051, close enough in my book to call equal. So, while in this example the consistent reads are cut in half, it did not yield any significant performance difference. I suspect the same for Robin's example, but it doesn't seem he provided any timings.

 

If you like Oracle tuning, you might enjoy my book "Oracle Tuning: The Definitive Reference", with 950 pages of tuning tips and scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.


    Need an Oracle Health Check?
  • Do you have bad performance after an upgrade?
     
  • Need to certify that your database follows best practices?

BC Oracle performance gurus can quickly certify every aspect of your Oracle database and provide a complete verification that your database is fully optimized.

 

 

 

 
 
 

Oracle performance tuning book

 

 

Oracle performance tuning software

 
Oracle performance tuning software
 
SearchOracle web site
 
Oracle performance Tuning 10g reference poster
 
Oracle performance tuning webcast
 
Oracle training in Linux commands
 
Oracle training Excel
 
Oracle training & performance tuning books
 

 

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.
 
 


Burleson Consulting

The Oracle of database support


 

Copyright © 1996 -  2007 by Burleson Enterprises, Inc. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.


Hit Counter