Hello, you are not logged in.  Login or sign up
Toad on Twitter Follow Toad Search Toad World Search
Blogger List   

All Recent Blog Entries
 

Johannes Ahrends
Unicode and Toad

Ben Boise
Toad SC Discussions

Kevin Dalton
Benchmark Factory

Steven Feuerstein
PL/SQL Obsession

Devin Gallagher
Toad SC discussions

Stuart Hodgins
JProbe Discussions

  Henrik "Mauritz" Johnson
Toad Tips & Tricks on the "other" Toads
  Mark Kurtz
Toad SC discussions
  Michael Lumbard
Toad SC discussions
Daniel Norwood
Toad for Data Analysts,
Toad Extension for Visual Studio
Debbie Peabody
Toad for Data Analysts
Gary Piper
Toad Reports Manager
John Pocknell
Toad for Oracle, JProbe
Kuljit Sangha
Toad SC discussions
Bert Scalzo Indicates Oracle ACE status
Toad for Oracle, Data Modeling, Benchmarking
Jeff Smith
Toad product family
Richard To
SQL Optimization
Jim Wankowski
DB2 - LUW and z/OS
John Weathington
  Toad World Editor
Toad World issues

  Toad Data Modeler Opens in a new window
Data Modeling
 
  Real Automated Code Testing for Oracle
Quest Code Tester blog

Blogs
Toad and Database Commentaries

Toad World blogs are a mix of insightful how-tos from Quest experts as well as their commentary on experiences with new database technologies.  Have some views of your own to share?  Post your comments!  Note:  Comments are restricted to registered Toad World users.

Do you have a topic that you'd like discussed?  We'd love to hear from you.  Send us your idea for a blog topic.

Executing SQL In Tuning Lab – Part 9 – Why Run Times Vary
 
Location: Blogs Richard To's Blog    
 RichardTo Friday, August 07, 2009 6:16 AM

This blog is a continuation of a series about test running the SQL statements in the Tuning Lab in Quest SQL Optimizer for Oracle to find the best performing SQL statement in your database environment. It covers why the run time of a SQL statement may vary from one execution to the next.

When you execute a SQL statement several times in Quest SQL Optimizer, you may notice that the run time will vary from one execution to the next. This adds an additional challenge to picking out the best SQL statement from a group of alternative statements.

The run time varies because each time the SQL statement is executed it is sharing the database and CPU processing with other jobs running on the computer. It is especially true for the first time you execute your SQL statement, since some data may be cached into memory. So it is normal that the first execution will take longer than the following executions. When you execute a SQL statement in the Quest SQL Optimizer, the run time (Total Elapsed Time) is the “clock time” from the moment that the SQL statement starts executing on the CPU to the moment it is finished. So since the execution of the SQL statement is sharing the CPU with other processes, the “clock time” is likely to vary from one execution to the next depending on how much sharing of the CPU occurred while the SQL statement was executing.
 
There is no overall solution to this challenge. To perform the run time testing of the SQL statements when there is less of a workload on the system is a good practice.
 
For SQL statements that run in sub-second times, it is recommended to run each SQL alternative several times using the Multiple-Execute option: Tuning Lab | Execution | Execution Method | Number of times to execute each scenario. See the previous blog Executing SQL In Tuning Lab – Part 3 – Equal Comparison for Run Times: Minimizing the Effect of Other Activities on the CPU for more information.
 
If you would like to learn more about Quest SQL Optimizer for Oracle, please visit the Inside SQL Optimizer for Oracle community.
Permalink |  Trackback
Search Blog Entries
 
Copyright 2010 by Quest Software  | Terms Of Use | Privacy Statement | Contact Us