{"id":835,"date":"2018-07-20T20:54:43","date_gmt":"2018-07-20T20:54:43","guid":{"rendered":"http:\/\/dbtut.com\/?p=835"},"modified":"2018-11-08T13:37:13","modified_gmt":"2018-11-08T13:37:13","slug":"what-is-paramater-sniffing","status":"publish","type":"post","link":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/","title":{"rendered":"What is Paramater Sniffing"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>Parameter Sniffing is the result of using the query plan in the cache.<\/p>\n<p>When a stored procedure is compiled the last time a query plan is created according to the incoming parameter, this query plan may not be suitable for the next parameter.<\/p>\n<p>In this case, the stored procedure may work with an inappropriate query plan and take much longer than expected.<\/p>\n<p>This can occur when running sp_executesql command with the parameter or in other technologies that generate parametric code such as linq.<\/p>\n<p>Sometimes you can observe sudden CPU increases in your systems.<\/p>\n<p>The average usage of the CPU may start to fluctuate from 20% to 100%.<\/p>\n<p>In this case, you may think that they are using the system intensively or they are taking a report.<\/p>\n<p>Of course, you may be experiencing parameter siniffing as well.<\/p>\n<p>The biggest indicator of the problem is parameter sniffing is to see that the longest running queries that are currently running on the system are from the same queries.<\/p>\n<p>You may use the tsql code in my article &#8220;<a href=\"https:\/\/dbtut.com\/index.php\/2018\/07\/22\/how-to-see-current-queries-on-sql-server\/\" target=\"_blank\" rel=\"noopener\">How To See Current Queries On SQL Server<\/a>&#8221;<\/p>\n<p>But the following way can be followed to make sure of this.<\/p>\n<p>When you run the tsql code in the above article, we take a text value in a row that is returned in the result set and transfer it to a new session.<\/p>\n<p>You should specify a specific field in the query you are sending to the new query screen and write it in the following script.<\/p>\n<p>For example, in the &#8220;Select Extent1.MaximumAge FROM tablea Extent1&#8221; query, we can add &#8220;Extent1.MaximumAge&#8221; to the section after the text like statement in the below script.<\/p>\n<pre class=\"lang:default decode:true\">SELECT [text], cp.size_in_bytes, plan_handle\r\nFROM sys.dm_exec_cached_plans AS cp\r\nCROSS APPLY sys.dm_exec_sql_text(plan_handle)\r\nWHERE cp.cacheobjtype = N'Compiled Plan'\r\nand text like '%Extent1.MaximumAge%'\r\nORDER BY cp.size_in_bytes DESC;<\/pre>\n<p>&nbsp;<\/p>\n<p>When we run the above query, we find the question causing the problem and note the value of plan_handle one time.<\/p>\n<p>To reset the query plan value of the problematic query in the cache, we add this plan_handle value to the relevant part of the following query.<\/p>\n<pre class=\"lang:default decode:true\">DBCC FREEPROCCACHE (value in plan_handle column);<\/pre>\n<p>&nbsp;<\/p>\n<p>In this way we allow the query to create a query plan again.<\/p>\n<p>If the CPU usage on the system returns to normal after a while, we can say that we are experiencing parameter sniffing.<\/p>\n<p>&nbsp;<\/p>\n<h3>How can we prevent the parameter sniffing?<\/h3>\n<p>There is more than one solution for this problem.<\/p>\n<p>First of all, if you know the distribution of the data and how the incoming parameters predominantly come from, you can apply the solution as follows.<\/p>\n<p>&nbsp;<\/p>\n<h3>Solution1:<\/h3>\n<p>For example, if the stored procedure gets x value 99% as a parameter and compiled according to y when it was compiled last time, every time we call the stored procedure with x, we will run the wrong query plan and parameter sniffing will occur.<\/p>\n<p>In such a case, we can solve this problem with adding a hint to the SP as follows.<\/p>\n<p>when we add this hint on sp, the query plan will occur based on the x value.<\/p>\n<p>Of course this solution can be used in very specific situations.<\/p>\n<pre class=\"lang:default decode:true\">SELECT\u00a0\u00a0* FROM TableXXX\r\nWHERE Kolon_A=@Param\r\nOPTION(OPTIMIZE FOR (@Param=x))<\/pre>\n<p>&nbsp;<\/p>\n<h3>Solution2:<\/h3>\n<p>We can add the following hint to recompile the SP every time.<\/p>\n<p>But in this solution, sp will be recompiled every time, so it will bring an unnecessary workload to the CPU.<\/p>\n<pre class=\"lang:default decode:true\">SELECT\u00a0\u00a0* ROM TableXXX\r\nWHERE Kolon_A=@Param\r\nOPTION(RECOMPILE)<\/pre>\n<p>&nbsp;<\/p>\n<h3>Solution3:<\/h3>\n<p>This solution is the solution I use on my own systems.<\/p>\n<p>At the end of the SP we add an expression for the variable that causes parameter sniffing as follows.<\/p>\n<p>You can provide the same query plan usage for each incoming value for this parameter.<\/p>\n<p>you can add &#8220;OPTION (OPTIMIZEFOR (@ parameter = UNKNOWN))&#8221; to create the same query plan for one parameter \u200b\u200bthat can cause parameter sniffing in the query.<\/p>\n<p>Or you can add &#8220;OPTION (OPTIMIZEFOR UNKNOWN)&#8221; to create the same query plan for all values \u200b\u200bthat can cause parameter sniffing in the query.<\/p>\n<p>Lets clarify this issue with a detailed example.<\/p>\n<p>Open a new session and create a stored procedure using the following script.<\/p>\n<pre class=\"lang:default decode:true\">CREATE PROCEDURE PS (@param int)\r\nAS\r\nSELECT * FROM Sales.SalesOrderDetail\r\nWHERE ProductID = @param<\/pre>\n<p>&nbsp;<\/p>\n<p>Before running this SP that we have created, let&#8217;s click on the include actual execution plan as shown in the figure below. In this way the query will give us the execution plan after it have finished.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/536.png\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>When we run the query, we get the following result.<\/p>\n<p>As you see, Actual number of rows and Estimated number of rows are the same.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/289.png\" width=\"590\" height=\"261\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Under normal circumstances, the best &#8220;query plan&#8221; occurs using the histogram.<\/p>\n<p>Now let&#8217;s examine the histogram of the Index.<\/p>\n<p>When we run the following query, we see 188 in the EQ_EOWS column for the record with RANGE_HI_KEY 709.<\/p>\n<pre class=\"lang:default decode:true\">DBCC SHOW_STATISTICS('Sales.SalesOrderDetail', 'IX_SalesOrderDetail_ProductID') WITH HISTOGRAM<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/694.png\" width=\"585\" height=\"255\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>But as we mentioned at the beginning of the topic, we may sometimes encounter parameter sniffing.<\/p>\n<p lang=\"en-US\">The first &#8220;query plan&#8221; produced according to a certain parameter using histogram is the best &#8220;query plan&#8221;, but it can be very bad compared to some later parameters.<\/p>\n<p>To prevent this, change the SP as follows.<\/p>\n<p>When we change the SP as follows, the query plan is created by looking at the density vector rather than looking at the histograms at the time of creation.<\/p>\n<p lang=\"en-US\">And regardless of what parameter the query comes from, it uses the same query plan every time.<\/p>\n<pre class=\"lang:default decode:true\">USE [AdventureWorks]\r\nGO\r\nALTER PROCEDURE [dbo].[PS] (@param int)\r\nAS\r\nSELECT * FROM Sales.SalesOrderDetail\r\nWHERE ProductID = @param\r\nOPTION (OPTIMIZE FOR (@param UNKNOWN))<\/pre>\n<p>&nbsp;<\/p>\n<p>And let&#8217;s run the SP again.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/728.png\" width=\"605\" height=\"277\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>As shown in the above example, the actual number of rows is 188, the estimated number of rows is calculated as 456.<\/p>\n<p>I can say that the query plan generated using the density vector is less healthy than the query plan generated using histograms, but blocks parameter sniffing in many scenarios.<\/p>\n<p>In the above example, it looks like it produced a bad value for the 709 ProductID according to the histogram.<\/p>\n<p>However, when working with 708 or 707 ProductId, it will work with a better query plan than the query plan generated by working with parameter 709 and using histograms.<\/p>\n<p>Factors such as the distribution of the data, how often the parameter arrives, and the size of the object determine whether this property is useful.<\/p>\n<p>You should absolutely test this feature before applying it in the production environment.<\/p>\n<p>You can do the test by creating a virtual workload.<\/p>\n\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_835\" class=\"pvc_stats all  \" data-element-id=\"835\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/dbtut.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Parameter Sniffing is the result of using the query plan in the cache. When a stored procedure is compiled the last time a query plan is created according to the incoming parameter, this query plan may not be suitable for the next parameter. In this case, the stored procedure may work with an inappropriate &hellip;<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_835\" class=\"pvc_stats all  \" data-element-id=\"835\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/dbtut.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3],"tags":[1012,1028,1025,1017,1011,1027,1020,1026,1010,1024,1014,1023,1022,1021,1013,1009,1016,1019,1015,1018,1008],"class_list":["post-835","post","type-post","status-publish","format-standard","","category-mssql","tag-param-unknown","tag-cpu-overhead","tag-dbcc-freeproccache","tag-dbcc-show_statistics","tag-density-vector","tag-dm_exec_cached_plans","tag-eq_eows","tag-freeproccache","tag-histogram","tag-optimize-for","tag-optimize-for-unknown","tag-optimizefor","tag-option-optimizefor-parameter-unknown","tag-option-optimizefor-unknown","tag-otimize-for","tag-paramater-sniffing","tag-quey-plan","tag-range_hi_key","tag-recompile","tag-show_statistics","tag-what-is-paramater-sniffing"],"aioseo_notices":[],"a3_pvc":{"activated":true,"total_views":589,"today_views":0},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is Paramater Sniffing - Database Tutorials<\/title>\n<meta name=\"description\" content=\"What is Paramater Sniffing\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Paramater Sniffing - Database Tutorials\" \/>\n<meta property=\"og:description\" content=\"What is Paramater Sniffing\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/\" \/>\n<meta property=\"og:site_name\" content=\"Database Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-20T20:54:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-08T13:37:13+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/536.png\" \/>\n<meta name=\"author\" content=\"dbtut\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"dbtut\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/\"},\"author\":{\"name\":\"dbtut\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408\"},\"headline\":\"What is Paramater Sniffing\",\"datePublished\":\"2018-07-20T20:54:43+00:00\",\"dateModified\":\"2018-11-08T13:37:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/\"},\"wordCount\":1009,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/dbtut.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/536.png\",\"keywords\":[\"@param UNKNOWN\",\"cpu overhead\",\"DBCC FREEPROCCACHE\",\"DBCC SHOW_STATISTICS\",\"density vector\",\"dm_exec_cached_plans\",\"EQ_EOWS\",\"FREEPROCCACHE\",\"histogram\",\"OPTIMIZE FOR\",\"OPTIMIZE FOR UNKNOWN\",\"OPTIMIZEFOR\",\"OPTION (OPTIMIZEFOR (@ parameter = UNKNOWN))\",\"OPTION (OPTIMIZEFOR UNKNOWN)\",\"OTIMIZE FOR\",\"Paramater Sniffing\",\"quey plan\",\"RANGE_HI_KEY\",\"recompile\",\"SHOW_STATISTICS\",\"What is Paramater Sniffing\"],\"articleSection\":[\"MSSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/\",\"url\":\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/\",\"name\":\"What is Paramater Sniffing - Database Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/dbtut.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/536.png\",\"datePublished\":\"2018-07-20T20:54:43+00:00\",\"dateModified\":\"2018-11-08T13:37:13+00:00\",\"description\":\"What is Paramater Sniffing\",\"breadcrumb\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#primaryimage\",\"url\":\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/536.png\",\"contentUrl\":\"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/536.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dbtut.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is Paramater Sniffing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dbtut.com\/#website\",\"url\":\"https:\/\/dbtut.com\/\",\"name\":\"Database Tutorials\",\"description\":\"MSSQL, Oracle, PostgreSQL, MySQL, MariaDB, DB2, Sybase, Teradata, Big Data, NOSQL, MongoDB, Couchbase, Cassandra, Windows, Linux\",\"publisher\":{\"@id\":\"https:\/\/dbtut.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dbtut.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dbtut.com\/#organization\",\"name\":\"dbtut\",\"url\":\"https:\/\/dbtut.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg\",\"contentUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg\",\"width\":223,\"height\":36,\"caption\":\"dbtut\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408\",\"name\":\"dbtut\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g\",\"caption\":\"dbtut\"},\"description\":\"We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.\",\"sameAs\":[\"http:\/\/NurullahCAKIR\"],\"url\":\"https:\/\/dbtut.com\/index.php\/author\/dbtut\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Paramater Sniffing - Database Tutorials","description":"What is Paramater Sniffing","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/","og_locale":"en_US","og_type":"article","og_title":"What is Paramater Sniffing - Database Tutorials","og_description":"What is Paramater Sniffing","og_url":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/","og_site_name":"Database Tutorials","article_published_time":"2018-07-20T20:54:43+00:00","article_modified_time":"2018-11-08T13:37:13+00:00","og_image":[{"url":"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/536.png","type":"","width":"","height":""}],"author":"dbtut","twitter_card":"summary_large_image","twitter_misc":{"Written by":"dbtut","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#article","isPartOf":{"@id":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/"},"author":{"name":"dbtut","@id":"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408"},"headline":"What is Paramater Sniffing","datePublished":"2018-07-20T20:54:43+00:00","dateModified":"2018-11-08T13:37:13+00:00","mainEntityOfPage":{"@id":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/"},"wordCount":1009,"commentCount":0,"publisher":{"@id":"https:\/\/dbtut.com\/#organization"},"image":{"@id":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#primaryimage"},"thumbnailUrl":"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/536.png","keywords":["@param UNKNOWN","cpu overhead","DBCC FREEPROCCACHE","DBCC SHOW_STATISTICS","density vector","dm_exec_cached_plans","EQ_EOWS","FREEPROCCACHE","histogram","OPTIMIZE FOR","OPTIMIZE FOR UNKNOWN","OPTIMIZEFOR","OPTION (OPTIMIZEFOR (@ parameter = UNKNOWN))","OPTION (OPTIMIZEFOR UNKNOWN)","OTIMIZE FOR","Paramater Sniffing","quey plan","RANGE_HI_KEY","recompile","SHOW_STATISTICS","What is Paramater Sniffing"],"articleSection":["MSSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/","url":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/","name":"What is Paramater Sniffing - Database Tutorials","isPartOf":{"@id":"https:\/\/dbtut.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#primaryimage"},"image":{"@id":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#primaryimage"},"thumbnailUrl":"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/536.png","datePublished":"2018-07-20T20:54:43+00:00","dateModified":"2018-11-08T13:37:13+00:00","description":"What is Paramater Sniffing","breadcrumb":{"@id":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#primaryimage","url":"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/536.png","contentUrl":"http:\/\/dbtut.com\/wp-content\/uploads\/2018\/07\/536.png"},{"@type":"BreadcrumbList","@id":"https:\/\/dbtut.com\/index.php\/2018\/07\/20\/what-is-paramater-sniffing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dbtut.com\/"},{"@type":"ListItem","position":2,"name":"What is Paramater Sniffing"}]},{"@type":"WebSite","@id":"https:\/\/dbtut.com\/#website","url":"https:\/\/dbtut.com\/","name":"Database Tutorials","description":"MSSQL, Oracle, PostgreSQL, MySQL, MariaDB, DB2, Sybase, Teradata, Big Data, NOSQL, MongoDB, Couchbase, Cassandra, Windows, Linux","publisher":{"@id":"https:\/\/dbtut.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dbtut.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/dbtut.com\/#organization","name":"dbtut","url":"https:\/\/dbtut.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/#\/schema\/logo\/image\/","url":"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg","contentUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg","width":223,"height":36,"caption":"dbtut"},"image":{"@id":"https:\/\/dbtut.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408","name":"dbtut","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g","caption":"dbtut"},"description":"We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.","sameAs":["http:\/\/NurullahCAKIR"],"url":"https:\/\/dbtut.com\/index.php\/author\/dbtut\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts\/835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/comments?post=835"}],"version-history":[{"count":0,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts\/835\/revisions"}],"wp:attachment":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/media?parent=835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/categories?post=835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/tags?post=835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}