首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 数据库 第二书店 程序员

Tag/ 


共416个网摘 [ 1  2  3  4  5  6 ... 14 ]  下一页  |  

SQL2005性能分析一些细节功能你是否有用到?(三)

zdg收录,使用标签:SQLSERVER, Performance,时间:2008-10-7 18:49:08 | 相关网摘我也收藏

当我们比较查询计划中那一个最好时,事实上我们更愿意用SET STATISTICS PROFILE ON,而不是SET SHOWPLAN_TEXT ON。它可以告诉你每种选择的或多或少的查询消耗情况;你还可以同时运行两个或更多查询来看哪个执行的最好。


SQL2005性能分析一些细节功能你是否有用到?(二)

zdg收录,使用标签:SQLSERVER, Performance,时间:2008-10-7 18:48:20 | 相关网摘我也收藏

上一篇:SQL2005性能分析一些细节功能你是否有用到? 我简单的提到了些关于SQL性能分析最基本的一些方法,下面的文章我会陆续补充.

前面提到了根据SQL的执行IO和执行计划来分析,还有一个特别重要的参数,就是SET STATISTICS TIME.


SQL2005性能分析一些细节功能你是否有用到?

zdg收录,使用标签:SQLSERVER, Performance,时间:2008-10-7 18:47:36 | 相关网摘我也收藏

一般根据大众分析SQL性能的基本方法:首先是看此SQL的执行IO成本,其次是看执行计划.


Sql嵌套

swwei2002收录,使用标签:SQLSERVER,时间:2008-10-7 16:01:13 | 相关网摘我也收藏

declare @a table (a int,b int,s int)
declare @b table (a int,b int,c int,d int,m int)
insert @a
select 1,2,20
union all
select 2,3,15

insert @b
select 1,2,3,9,5
union all
select 1,2,4,10,12
union all
select 1,2,5,11,10
union all
select 1,2,6,12,5
union all
select 2,3,4,6,10
union all
select 2,3,5,7,5
union all
select 2,3,6,8,10


select b.a,b.b,b.c,b.d,
case when b.summ-b.m>a.s then b.m else b.summ-a.s end as m
from @a a,(
select x.*,(select sum(m) from @b where a=x.a and b=x.b and d<=x.d) as Summ
from @b x
) b
where a.a=b.a
and a.b=b.b
and b.summ>a.s



共416个网摘 [ 1  2  3  4  5  6 ... 14 ]  下一页

Tag/相关标签



    网站简介广告服务网站地图帮助联系方式诚聘英才English 问题报告
    北京创新乐知广告有限公司 版权所有 京 ICP 证 070598 号
    Copyright © 2000-2008, CSDN.NET, All Rights Reserved