大家听到“嗅探”这个词应该会觉得跟黑客肯定有关系吧,使用工具嗅探一下参数,然后截获,脱裤o(∩_∩)o .事实上,我觉得大家太敏感了,其实这篇文章跟数据库安全没有什么关系,实际上跟数据库性能调优有关相信大家有泡SQLSERVER论坛的话不多不少应该都会见过“参数嗅探”这几个字这里有三篇帖子都是讲述参数嗅探的: SQL写法导致的SQL2008性能问题 Under the Table - How Data Access Code Affects Database Performance 困扰多时的查…
---从计划缓存中直接获取查询计划和参数: ), ) SELECT @dbname = 'hydee_连锁', @procname = 'dbo.p_select_ware'; WITH basedata AS ( AS stmt_start, qs.statement_end_offset AS stmt_end, est.encrypted AS isencrypted, est.TEXT AS sqltext, epa.value AS set_options, qp.query_plan…
1.缺失索引: USE AdventureWorks2014 SET STATISTICS TIME ON; SET STATISTICS IO ON ; SELECT per.FirstName,per.LastName,p.Name,p.ProductNumber,soh.OrderDate,sod.LineTotal,soh.TotalDue FROM sales.SalesOrderHeader AS soh INNER JOIN sales.SalesOrderDetail sod O…