【100分】真正的疑难问题,相同的语句,效率天差地别!!!!!!!!!!!
如题,下面的是相关说明:
--视图V_test:select a.1,a.2,a.3,b.1,b.2,b.3 from a inner join b on a.0=b.0--语句1:Select top 15 * FROM (select ROW_NUMBER() Over(order by id) as rowId, * from V_testwhere type=123 and zt='测试') as tempTable where rowId > 0--语句2:Select top 15 * FROM (select ROW_NUMBER() Over(order by id) as rowId, * from V_testwhere type=123 and zt='测试') as tempTable where rowId > 15--说明,所有相关子段都加了索引,视图数据总量277万。--语句1瞬间就出来了,语句2接近一分钟才出结果--查看数据库记录,语句2逻辑读非常高--为什么?两个语句完全一样,除了最后那个分页起始条件不同!--求教各路高手不吝赐教啊[img=http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/54.gif][/img]