Oct 29, 2019 6:30:00 AM by Jeff Surretsky
Within Toad, you can optimize SQL that has been identified as an issue. This is a self-contained functionality and nothing is required by the respective database vendors (Oracle, MS SQL Server). SQL Optimizer generates semantically equivalent alternatives with unique execution plans for your original SQL statement and then executes the alternatives to test each statement's performance. This will provide you with execution times and runtime statistics that allow you to find the best SQL statement for your database environment.
If you have used this feature within Toad, you may be most familiar with the use case of being reactive; i.e., a SQL statement is currently running and taking a very long time. Or, you are developing SQL for the first time and want to see if it is optimal. These are the viable use cases for optimizing SQL that are most widely known.
Another use case is to proactively scan for SQL that may not be running. This is the “Scan SQL” feature within Toad SQL Optimizer. You can scan a variety of sources for SQL as follows:
Once this scan is run, a report is produced which will categorize your imbedded SQL statements as Complex and/or Problematic, as seen below. While these SQL statements may not necessarily need to be optimized, they certainly present an opportunity for further investigation on a finite set of statements.
Only by sending them to be optimized will you be able to see if they can be improved.
After sending the specific SQL to be optimized, you will get your best alternatives based upon your tuning goals (Elapsed Time is the default):
Most developers and DBAs use Toad for Oracle to reduce time and effort to develop and manage Oracle databases. But did you know Toad can now find and control sensitive data across all your Oracle databases? What else can Toad do that you didn’t know about?
Written by Jeff Surretsky
Jeffrey Surretsky has been working at Quest since 2000 as a Sales Engineer focusing on a wide variety of solutions including Foglight, SharePlex and the TOAD Family of Products. Before working at Quest, he was a DBA for various organizations spanning a diverse range of industries. With over 30 years of experience in Information Technology, Jeffrey has a Bachelor’s Degree in Computer Science and an MBA in Management of Information Systems.