<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SQL Database – Complex Issue: Parameter Sniffing Causing Severe Query Regression After Statistics in SQL database</title>
    <link>https://community.fabric.microsoft.com/t5/SQL-database/SQL-Database-Complex-Issue-Parameter-Sniffing-Causing-Severe/m-p/4900414#M528</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1396709" data-lia-user-login="SavioFerraz" class="lia-mention lia-mention-user"&gt;SavioFerraz&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;Thank you for reaching out to the Microsoft Fabric Community Forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This scenario needs deeper review by the Azure SQL engine team. Please submit this case in the Azure SQL Q&amp;amp;A forum under the Azure SQL Database category. The link provided here:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/answers/tags/51/azure-sql-database" target="_blank"&gt;Azure SQL Database - Microsoft Q&amp;amp;A&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please raise a thread there in Azure SQL Database forum. So the appropriate experts can provide accurate guidance.&lt;/P&gt;
&lt;P&gt;Thank you for using the Microsoft Fabric Community Forum.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Dec 2025 07:30:41 GMT</pubDate>
    <dc:creator>v-kpoloju-msft</dc:creator>
    <dc:date>2025-12-12T07:30:41Z</dc:date>
    <item>
      <title>SQL Database – Complex Issue: Parameter Sniffing Causing Severe Query Regression After Statistics</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/SQL-Database-Complex-Issue-Parameter-Sniffing-Causing-Severe/m-p/4899724#M526</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I’m facing a challenging performance issue in a SQL Database environment (Azure SQL Database / SQL Server), and I’d appreciate community insights to confirm whether this behavior is expected or if there is a deeper root cause.&lt;/P&gt;&lt;P&gt;🟦 Scenario&lt;/P&gt;&lt;P&gt;I have a stored procedure that queries a large table (~450M rows) with selective and non-selective filters.&lt;BR /&gt;The table has:&lt;/P&gt;&lt;P&gt;A clustered columnstore index&lt;/P&gt;&lt;P&gt;Three filtered nonclustered indexes&lt;/P&gt;&lt;P&gt;A datetime2 partitioning column&lt;/P&gt;&lt;P&gt;Multiple predicates depending on customer and region&lt;/P&gt;&lt;P&gt;The stored procedure receives two parameters:&lt;/P&gt;&lt;P&gt;@CustomerId INT,&lt;BR /&gt;@RegionCode VARCHAR(5)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Depending on parameter selectivity, the optimizer should choose:&lt;/P&gt;&lt;P&gt;Index seek → narrow execution plan for highly selective customers&lt;/P&gt;&lt;P&gt;Columnstore scan → batch mode for broad regional queries&lt;/P&gt;&lt;P&gt;However…&lt;/P&gt;&lt;P&gt;🟥 Problem&lt;/P&gt;&lt;P&gt;Whenever AUTO_UPDATE_STATISTICS kicks in, my stored procedure suddenly regresses:&lt;/P&gt;&lt;P&gt;SQL Server generates a plan optimized for a non-selective parameter.&lt;/P&gt;&lt;P&gt;That plan becomes cached.&lt;/P&gt;&lt;P&gt;All selective parameter executions switch to a full table scan in columnstore, even when a targeted nonclustered index is available.&lt;/P&gt;&lt;P&gt;CPU usage spikes by 10×.&lt;/P&gt;&lt;P&gt;Query duration increases from 80 ms → 18 seconds.&lt;/P&gt;&lt;P&gt;Attempts so far:&lt;/P&gt;&lt;P&gt;OPTION (RECOMPILE): fixes regression but too expensive for high call volume&lt;/P&gt;&lt;P&gt;OPTIMIZE FOR UNKNOWN: generates a generic but still suboptimal plan&lt;/P&gt;&lt;P&gt;Forced plan via Query Store: breaks when schema evolves&lt;/P&gt;&lt;P&gt;Updating stats with FULLSCAN: temporary improvement only&lt;/P&gt;&lt;P&gt;Creating additional filtered indexes: no impact on plan stability&lt;/P&gt;&lt;P&gt;This appears to be classic parameter sniffing, but much more extreme due to columnstore interactions.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":question_mark:"&gt;❓&lt;/span&gt; Questions&lt;/P&gt;&lt;P&gt;Is this pattern expected when columnstore indexes are combined with parameter-sensitive predicates?&lt;/P&gt;&lt;P&gt;Is there a best practice for eliminating parameter sniffing without forcing RECOMPILE on a high-throughput stored procedure?&lt;/P&gt;&lt;P&gt;Would splitting the stored procedure into two versions (Selective vs Broad) actually help, or does Query Store override that?&lt;/P&gt;&lt;P&gt;Is this a known issue related to recent engine changes in Azure SQL Database?&lt;/P&gt;&lt;P&gt;Should I consider converting the filtered nonclustered indexes into aligned or partitioned versions?&lt;/P&gt;&lt;P&gt;Any guidance would be greatly appreciated — this issue is impacting production workloads.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2025 12:30:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/SQL-Database-Complex-Issue-Parameter-Sniffing-Causing-Severe/m-p/4899724#M526</guid>
      <dc:creator>SavioFerraz</dc:creator>
      <dc:date>2025-12-11T12:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Database – Complex Issue: Parameter Sniffing Causing Severe Query Regression After Statistics</title>
      <link>https://community.fabric.microsoft.com/t5/SQL-database/SQL-Database-Complex-Issue-Parameter-Sniffing-Causing-Severe/m-p/4900414#M528</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1396709" data-lia-user-login="SavioFerraz" class="lia-mention lia-mention-user"&gt;SavioFerraz&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;Thank you for reaching out to the Microsoft Fabric Community Forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This scenario needs deeper review by the Azure SQL engine team. Please submit this case in the Azure SQL Q&amp;amp;A forum under the Azure SQL Database category. The link provided here:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/answers/tags/51/azure-sql-database" target="_blank"&gt;Azure SQL Database - Microsoft Q&amp;amp;A&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please raise a thread there in Azure SQL Database forum. So the appropriate experts can provide accurate guidance.&lt;/P&gt;
&lt;P&gt;Thank you for using the Microsoft Fabric Community Forum.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Dec 2025 07:30:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/SQL-database/SQL-Database-Complex-Issue-Parameter-Sniffing-Causing-Severe/m-p/4900414#M528</guid>
      <dc:creator>v-kpoloju-msft</dc:creator>
      <dc:date>2025-12-12T07:30:41Z</dc:date>
    </item>
  </channel>
</rss>

