Sql 一个SQL语句的优化
2011-12-07 14:10
281 查看
这是一个sql语句优化的过程。使用子查询与不使用子查询的效率对比
select sum(sl0000) from xstfxps2 where
dhao00 in (
select dhao00 from xstfxps1 where trunc(ywrq00)=trunc(sysdate)
and khdm00='500000003913');
已用时间: 00: 02: 49.04
select sum(sl0000)
from xstfxps2 a,(select dhao00 from xstfxps1 where trunc(ywrq00)=trunc(sysdate)
and khdm00='500000003913') b
where a.dhao00=b.dhao00;
已用时间: 00: 00: 03.05
select sum(sl0000) from xstfxps2 where
dhao00 in (
select dhao00 from xstfxps1 where trunc(ywrq00)=trunc(sysdate)
and khdm00='500000003913');
已用时间: 00: 02: 49.04
select sum(sl0000)
from xstfxps2 a,(select dhao00 from xstfxps1 where trunc(ywrq00)=trunc(sysdate)
and khdm00='500000003913') b
where a.dhao00=b.dhao00;
已用时间: 00: 00: 03.05
相关文章推荐
- Sql 一个SQL语句的优化
- 一个sql语句的优化
- 如何优化以下的一个sql语句
- 一个sql语句的优化及oracle翻页
- 自己实现一个SQL解析引擎 功能:将用户输入的SQL语句序列转换为一个可执行的操作序列,并返回查询的结果集。 SQL的解析引擎包括查询编译与查询优化和查询的运行,主要包括3个步骤: 查询分析
- 一个Web报表项目的性能分析和优化实践(一):小试牛刀,统一显示SQL语句执行时间
- 一个sql语句的优化
- 一个SQL语句的优化
- 一个 Sql语句优化的问题- STATISTICS 统计信息
- 一个Web报表项目的性能分析和优化实践(一):小试牛刀,统一显示SQL语句执行时间
- 一次ORA-4030问题诊断及解决【解决思路不错,说明了对象的统计信息与优化器的优化操作(即选择执行一个SQL语句在该优化参数环境下最佳的执行计划)间的关系】
- 一个Web报表项目的性能分析和优化实践(一):小试牛刀,统一显示SQL语句执行时间
- [置顶] 一个Web报表项目的性能分析和优化实践(一):小试牛刀,统一显示SQL语句执行时间
- 一个Web报表项目的性能分析和优化实践(一):小试牛刀,统一显示SQL语句执行时间
- 关于SQL语句优化的一个问题
- 一个查选优化的例子,转--SQL Server中存储过程比直接运行SQL语句慢的原因
- 一个查选优化的例子,转--SQL Server中存储过程比直接运行SQL语句慢的原因
- 一个简单的SQL语句拼装代码
- 优化---利用pl/sql执行计划评估SQL语句的性能简析
- SQL Server中的SQL语句优化与效率