Use toad for SQL Optimization

Source: Internet
Author: User

It is very easy for us to implement SQL tuning by toad. we need to do is just give complex SQL statement to Toad. The article
Give you some examples to demonstrate how to tuning SQL by toad for Oracle.

 

1. Get execution plan
Editor --> explain Plan current SQL or Ctrl + E
 

2. Get statistics/auto trace
Enable auto trace panel.

Or you can right click and choose auto trace to enable it in SQL editor blank.

 

3. Get statistics after executed SQL.
 

4. tuning SQL

Executed SQL

 

Then current SQL will be executed and alternative SQL statement will be generated.

 

5. Compare result
 

From above using where clause replace having clause is fine.

Actually SQL tuning tools is derived from Quest SQL optimizer. If you learn more please go through http://www.quest.com/sql-optimizer-for-oracle/

Although SQL tuning optimizer help us a lot, Master SQL tuning we shoshould have deep understand such like SQL Execution Plan,
Auto trace statistics, table join, index and so on.

The demo is based on toad for Oracle 10.5.0.41

Author: Robinson Cheng

Blog: http://blog.csdn.net/robinson_0612

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.