小虎 2015-12-02 05:38 采纳率: 0%
浏览 1342
已结题

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

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求daily translation(DT)偏差订正方法的代码
    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 关于#python#的问题:自动化测试