易截截图软件、单文件、免安装、纯绿色、仅160KB

sql 2005 强制使用执行计划 T—SQl

select * from tt t inner loop join ss s with(nolock) on s.c=t.c
 
 使用 nested join
select * from tt t inner merge join ss s with(nolock) on s.c=t.c
 
 使用 merge join
 
select * from tt t inner hash join ss s with(nolock) on s.c=t.c
 
使用  hash jion
 
nolock 不允许锁 
 
 
 
 
Microsoft SQL Server sometimes uses hash and merge joins when querying large tables when uncomplicated nested loop joins would result in better performance and less server impact. In many such cases, query times go from many milliseconds to many seconds because hash table joins require that large amounts of data be processed and temporarily stored, and merge joins require sorting and then processing similarly large amounts of data.
This is fine for one-time administrative "fact finding" queries where you don't have or want the indices needed to optimize the query, and you're willing to wait the seconds or minutes it takes to get results.
For day-in-and-day-out application queries, however, you don't want your database engine to be hashing or sorting hundreds of thousands or millions of rows, especially when the end result is only a small number of rows.


相关文档:

猜猜看,Hibernate会执行几句SQL(一)

POEAA中介绍了ORM中最重要的模式之一:Unit Of Work。看似简单,实现起来却非常复杂。
Hibernate完美的实现了这个模式。以下我用一系列的例子来分析Hibernate的处理机制
下面有三个例子,猜猜看Hibernate会执行几句SQL(省略事务处理代码,实体对象叫User,假设主键是自增型的)
例1:
User user = new User();
user.setN ......

SQL快速用启动


开启各种服务
      @NET stop SQLSERVERAGENT
      @NET stop MSSQLServerOLAPService
      @NET stop msftesql
      @NET stop MsDtsServer
      @NET stop SQLWriter
  ......

组合索引优化SQL续

昨天我说,用组合索引优化SQL,并不是最优的,这是因为在8亿的表上面有个等价的物化视图,这个物化视图可以代替我在之前在表上面建立的组合索引。
SQL> explain plan for SELECT distinct * from (select
  2   (PROD_9005_GDF_WK_SS_FDIM.PROD_4_NAME),
  3    PROD_9005_GDF_WK ......

SQL Server2005 Analysis Services展示 OLAP

通过EXCEL导入SSAS项目
(1)本地配置HTTP
主要步骤:
I)新建目录olap,拷贝文件将 %Installation folder%\OLAP\bin\isapi 目录的内容,主要是msmdpump.dll和msmdpump.ini;
II)建立虚拟目录olap, 配置msmdpump.dll,目录安全性选择匿名访问和windows集成。 
http://www.microsoft.com/china/technet/prodtechn ......

在SQL SERVER 2008 中附加MDF&LDF

首先启动SQL SERVER的服务
连接后 在数据库上右键
选择附加。。。
点击 添加。。。
在跳出框内找到你的MDF文件位置 选中 添加进去
相同文件夹内的LDF文件自动加上
完成~~(*^__^*) 嘻嘻……
OK啦 呵呵
初学初学~希望也能帮到其他像我一样的初学者
大家一起加油吧!O(∩_∩)O~ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号