小虎
2015-12-02 05:38
采纳率: 0%
浏览 1.3k

SQL Server查询效率问题,哪个高手可以帮忙解释下?

下面5个SQL查询效率差异很多,BusinessIndex表中有300万条记录,
其中DatAuthor建立有索引,其它字段没有索引。
哪个高手可以分析下什么原因? 非常感谢!
SELECT strCode, strIndex from BusinessIndex where 1=1 and UserOrgID=1 and ( BusinessIndex.strIndex like '%热水器%')

--查询4s

SELECT strAuthor, strIndex from BusinessIndex where 1=1 and UserOrgID=1 and ( BusinessIndex.strIndex like '%热水器%')

--查询4s

SELECT strCode,strAuthor, strIndex from BusinessIndex where 1=1 and UserOrgID=1 and ( BusinessIndex.strIndex like '%热水器%')

--查询39s

SELECT ROW_NUMBER() OVER (order by datAuthor Desc ) as hibernate_row_nr,
strCode, strAuthor,strIndex from BusinessIndex where 1=1 and UserOrgID=1 and ( BusinessIndex.strIndex like '%热水器%')
--查询4s

SELECT top 20 ROW_NUMBER() OVER (order by datAuthor Desc ) as hibernate_row_nr,
strCode, strAuthor,strIndex from BusinessIndex where 1=1 and UserOrgID=1 and ( BusinessIndex.strIndex like '%热水器%')
--查询40s

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

相关推荐 更多相似问题