<?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 Slow Update Query on Dimension table with only 10 rows in Data Warehouse</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Slow-Update-Query-on-Dimension-table-with-only-10-rows/m-p/4706442#M3082</link>
    <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone explain to me why this very simple update query is taking 30s on average?&lt;/P&gt;&lt;P&gt;I only have 10 rows in that table so I don't understand why this query takes so extremely long:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;UPDATE DimLocation SET [Last Updated] = GETUTCDATE(), [Last Update (Local Time)] = DateADD(hour, [Time Zone Offset],GETUTCDATE())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated&lt;/P&gt;&lt;P&gt;Nico&lt;/P&gt;</description>
    <pubDate>Sun, 25 May 2025 23:57:52 GMT</pubDate>
    <dc:creator>ntimmerman</dc:creator>
    <dc:date>2025-05-25T23:57:52Z</dc:date>
    <item>
      <title>Slow Update Query on Dimension table with only 10 rows</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Slow-Update-Query-on-Dimension-table-with-only-10-rows/m-p/4706442#M3082</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone explain to me why this very simple update query is taking 30s on average?&lt;/P&gt;&lt;P&gt;I only have 10 rows in that table so I don't understand why this query takes so extremely long:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;UPDATE DimLocation SET [Last Updated] = GETUTCDATE(), [Last Update (Local Time)] = DateADD(hour, [Time Zone Offset],GETUTCDATE())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated&lt;/P&gt;&lt;P&gt;Nico&lt;/P&gt;</description>
      <pubDate>Sun, 25 May 2025 23:57:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Slow-Update-Query-on-Dimension-table-with-only-10-rows/m-p/4706442#M3082</guid>
      <dc:creator>ntimmerman</dc:creator>
      <dc:date>2025-05-25T23:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Slow Update Query on Dimension table with only 10 rows</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Slow-Update-Query-on-Dimension-table-with-only-10-rows/m-p/4706812#M3085</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="732249" data-lia-user-login="ntimmerman" class="lia-mention lia-mention-user"&gt;ntimmerman&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for reaching out to us on the Microsoft Fabric Community Forum.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Microsoft Fabric Data Warehouse can be slow due to the underlying distributed architecture and transactional mechanics.&lt;/P&gt;
&lt;P&gt;Please refer below possible chances.&lt;/P&gt;
&lt;P&gt;1. Distributed Query Processing Overhead:&lt;/P&gt;
&lt;P&gt;Even for a small table with 10 rows, Fabric treats it as part of a distributed system. Data movement between control node and compute nodes, and the whole distributed transaction engine kicks in even if unnecessary.&lt;/P&gt;
&lt;P&gt;2. Columnstore vs. Rowstore:&lt;/P&gt;
&lt;P&gt;If DimLocation is stored as a columnstore table (default for Fabric DW), then updates are internally converted to a delete + insert, which is very inefficient for small updates. Updates on columnstore tables are not optimized for row-level changes. This can lead to high latency, even if you're updating just 10 rows.&lt;/P&gt;
&lt;P&gt;3. Transaction Logging and Versioning:&lt;/P&gt;
&lt;P&gt;Updates trigger versioning and logging operations across distributed partitions. Fabric tries to maintain ACID properties, and that involves a fair amount of coordination overhead.&lt;/P&gt;
&lt;P&gt;4. Statistics/Indexing Not Relevant:&lt;/P&gt;
&lt;P&gt;Even if you have indexes or updated statistics, they don't significantly help UPDATE performance on columnstore tables.&lt;/P&gt;
&lt;P&gt;Please follow below steps to fix the issue:&lt;/P&gt;
&lt;P&gt;Option 1: Convert to HEAP or CLUSTERED INDEX (Rowstore).&lt;/P&gt;
&lt;P&gt;If the table has few rows and gets frequent updates. Then point your ETL/report to the new table.&lt;/P&gt;
&lt;P&gt;Option 2: Use CTAS Instead of UPDATE&lt;/P&gt;
&lt;P&gt;Use a Create Table As Select (CTAS) or MERGE instead of update:&lt;/P&gt;
&lt;P&gt;Option 3: Use MERGE if appropriate&lt;/P&gt;
&lt;P&gt;Sometimes, MERGE can be faster depending on internal optimization, though it's still columnstore-unfriendly:&lt;/P&gt;
&lt;P&gt;Note: Avoid UPDATE statements on columnstore tables unless absolutely necessary. For frequently updated small dimension tables, prefer rowstore (heap or clustered index) and replicated distribution. Use CTAS + swap approach for better performance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer Microsoft official articles and community threads.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-warehouse/troubleshoot-fabric-data-warehouse" target="_blank"&gt;Troubleshoot the Warehouse - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-warehouse/guidelines-warehouse-performance" target="_blank"&gt;Performance Guidelines - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-warehouse/query-activity" target="_blank"&gt;Monitor Your Running and Completed Queries Using Query Activity - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Data-Warehouse/Performance-issue-with-running-long-queries-on-both-lakehouse/m-p/3566097" target="_blank"&gt;Solved: Re: Performance issue with running long queries on... - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Fabric-platform/Fabric-Takes-a-relatively-long-time-to-insert-a-record-into-a/td-p/4633061" target="_blank"&gt;Solved: Fabric: Takes a relatively long time to insert a r... - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If my response has resolved your query, please mark it as the &lt;STRONG&gt;"Accepted Solution"&lt;/STRONG&gt; to assist others. Additionally, a &lt;STRONG&gt;"Kudos"&lt;/STRONG&gt; would be appreciated if you found my response helpful.&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 06:31:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Slow-Update-Query-on-Dimension-table-with-only-10-rows/m-p/4706812#M3085</guid>
      <dc:creator>v-dineshya</dc:creator>
      <dc:date>2025-05-26T06:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Slow Update Query on Dimension table with only 10 rows</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Slow-Update-Query-on-Dimension-table-with-only-10-rows/m-p/4710048#M3096</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1249554" data-lia-user-login="v-dineshya" class="lia-mention lia-mention-user"&gt;v-dineshya&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your prompt response and all the background information.&lt;/P&gt;&lt;P&gt;In the end, I conducted further experimentation, and it appears that the GETUTCDATE() function call in the update statement significantly slows it down.&lt;/P&gt;&lt;P&gt;So, I've now introduced a variable to store the current UTC date, and then I'm updating all records based on that variable instead. This makes the query a lot faster&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 07:33:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Slow-Update-Query-on-Dimension-table-with-only-10-rows/m-p/4710048#M3096</guid>
      <dc:creator>ntimmerman</dc:creator>
      <dc:date>2025-05-28T07:33:16Z</dc:date>
    </item>
  </channel>
</rss>

