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 many 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 should 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

Toad 实现 SQL 优化的更多相关文章

  1. Oracle SQL优化[转]

    Oracle SQL优化 1. 选用适合的ORACLE优化器 ORACLE的优化器共有3种: a. RULE (基于规则) b. COST (基于成本) c. CHOOSE (选择性) 设置缺省的优化 ...

  2. Oracle SQL优化原则

    原文:http://bbs.landingbj.com/t-0-240353-1.html 1.选用适合的 ORACLE 优化器 2.访问 Table 的方式 3.共享SQL语句 共享的语句必须满足三 ...

  3. Oracle SQL Developer,Oracle 开发工具之toad、SQL Developer、PL/SQL Developer等比较

    参考: oracle 的几个开发工具比较 因Oracle几乎是中大型商业企业数据的首选,所以比较一下常用与Oracle的工具. Oracle SQL Developer 免费,一般开发使用足矣,常用. ...

  4. Oracle SQL优化规则详解

    1. 选用适合的Oracle优化器 Oracle的优化器共有3种: a. RULE (基于规则) b. COST (基于成本) c. CHOOSE (选择性) 设置缺省的优化器,可以通过对init.o ...

  5. 【重磅干货】看了此文,Oracle SQL优化文章不必再看!

    目录 SQL优化的本质 SQL优化Road Map 2.1 制定SQL优化目标 2.2 检查执行计划 2.3 检查统计信息 2.4 检查高效访问结构 2.5 检查影响优化器的参数 2.6 SQL语句编 ...

  6. SQL优化案例—— RowNumber分页

    将业务语句翻译成SQL语句不仅是一门技术,还是一门艺术. 下面拿我们程序开发工程师最常用的ROW_NUMBER()分页作为一个典型案例来说明. 先来看看我们最常见的分页的样子: WITH CTE AS ...

  7. sql 优化

    1.选择最有效率的表名顺序(只在基于规则的优化器中有效): oracle的解析器按照从右到左的顺序处理 from 子句中的表名,from子句中写在最后的表(基础表driving table)将被最先处 ...

  8. SQL 优化总结

    SQL 优化总结 (一)SQL Server 关键的内置表.视图 1. sysobjects         SELECT name as '函数名称',xtype as XType  FROM  s ...

  9. (转)SQL 优化原则

    一.问题的提出 在应用系统开发初期,由于开发数据库数据比较少,对于查询SQL语句,复杂视图的的编写等体会不出SQL语句各种写法的性能优劣,但是如果将应用 系统提交实际应用后,随着数据库中数据的增加,系 ...

随机推荐

  1. Spring Boot AOP

    AOP为Aspect Oriented Programming的缩写,意为:面向切面编程,通过预编译方式和运行期动态代理实现程序功能的统一维护的一种技术.AOP是Spring框架中的一个重要内容,它通 ...

  2. 第七章 二叉搜索树(d4)AVL树:(3+4)-重构

  3. 第八章 高级搜索树 (b2)B-树:结构

  4. Python3 input() 函数

    Python3 input() 函数  Python3 内置函数 Python3.x 中 input() 函数接受一个标准输入数据,返回为 string 类型. 注意:在 Python3.x 中 ra ...

  5. tf.random_normal()

    tf.random_normal()函数用于从服从指定正太分布的数值中取出指定个数的值. tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf. ...

  6. 55. Jump Game (Array; Greedy)

    Given an array of non-negative integers, you are initially positioned at the first index of the arra ...

  7. 在c#中设置Excel格式

    生成excel的时候有时候需要设置单元格的一些属性,可以参考一下: range.NumberFormatLocal = "@"; //设置单元格格式为文本 ange.get_Ran ...

  8. [leetcode]721. Accounts Merge账户合并

    Given a list accounts, each element accounts[i] is a list of strings, where the first element accoun ...

  9. CComSafeArray

    https://blog.csdn.net/tangaowen/article/details/6554640

  10. Vagrant WinNFSd

    Vagrant WinNFSd Manage and adds support for NFS on Windows. Supported Platforms As of version 1.0.6 ...