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

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


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


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 
 

Oracle MREADTIM and SREADTIM workload statistics

Oracle Database Tips by Donald BurlesonNovember 22, 2015

 

Oracle knows that the external environment has a profound impact on SQL performance, and the Oracle cost-based optimizer now has the ability to consider real-world timings for multiblock reads (mreadtim) and sequential read I/O times (sreadtim) within the dbms_stats.gather_system_stats procedure.

Oracle has two types of CBO statistics for estimating disk read times workload and "noworkload" statistics.  The ?noworkload? statistics gather data by submitting random reads against all data files, while the workload statistics increments internal counters to measure database I/O activity.

  • Noworkload statistics - These include CPUSPEEDNW, IOSEEKTIM and IOTFRSPEED.
     
  • Workload statistics - These are gathered by dbms_stats.gather_system_stats and include SREADTIM, MREADTIM, CPUSPEED, MBRC, MAXTHR, and SLAVETHR represent workload statistics.

If both workload and noworkload statistics are available, the optimizer uses the workload statistics in hopes of getting the ?best? execution plan for the SQL.  You can run this query to see the current values for your database:

SQL> select sname, pname, pval1
 from sys.aux_stats$;

 SNAME       PNAME      PVAL1
 ------------- ---------  -------
 SYSSTATS_INFO   STATUS 
 SYSSTATS_INFO   DSTART
 SYSSTATS_INFO   DSTOP
 SYSSTATS_INFO   FLAGS           1
 SYSSTATS_MAIN   CPUSPEEDNW    502.005
 SYSSTATS_MAIN   IOSEEKTIM      10
 SYSSTATS_MAIN   IOTFRSPEED   4096
 SYSSTATS_MAIN   SREADTIM        7.618
 SYSSTATS_MAIN   MREADTIM       14.348
 SYSSTATS_MAIN   CPUSPEED      507
 SYSSTATS_MAIN   MBRC            6 
 SYSSTATS_MAIN   MAXTHR      32768  
 SYSSTATS_MAIN   SLAVETHR     
 
 13 rows selected.

Oracle workload statistics that are gathered with dbms_stats.gather_system_stats now gather real-workload I/O performance metrics: 

  • SREADTIM  - Single block read time in milliseconds
     
  • MREADTIM - Multiblock read time in ms
     
  • CPUSPEED - CPU speed
     
  • MBRC - Average blocks read per multiblock read (see db_file_multiblock_read_count)
     
  • MAXTHR - Maximum I/O throughput (for OPQ only)
     
  • SLAVETHR - OPQ Factotum (slave) throughput (OPQ only)   

When the multiblock read time is less than single block disk read time (mreadtim <= sreadtim), then the query plan costing will not use the workload statistics.

The Oracle 10g Performance Tuning Guide notes that the timing of the workload sample is important and that you want to run your samples during a time when you are performing legitimate multiblock reads (or, stage a workload that performs full-table scans):

During the gathering process of workload statistics, it is possible that mbrc and mreadtim will not be gathered if no table scans are performed during serial workloads, as is often the case with OLTP systems.

On the other hand, FTS occur frequently on DSS systems but may run parallel and bypass the buffer cache. In such cases, sreadtim will still be gathered since index lookup are performed using the buffer cache.

The docs also note that :"bad timing" of a system statistics sample can cause less than optimal estimates for the timings of full-table scan I/O:

If Oracle cannot gather or validate gathered mbrc or mreadtim, but has gathered sreadtim and cpuspeed, then only sreadtim and cpuspeed will be used for costing.

FTS cost will be computed using analytical algorithm implemented in previous releases. Another alternative to computing mbrc and mreadtim is to force FTS in serial mode to allow the optimizer to gather the data.

Learn more about mreadtim and sreadtim

See my related notes on Oracle workload statistics and optimizer behavior:

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.


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

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

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.