<?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: Databricks SQL script slow execution in workflows using serverless in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78511#M35545</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/29876"&gt;@BilalAslamDbrx&lt;/a&gt;&amp;nbsp;thanks for looking into this and confirming the issue. This doesn't happen if the SQL notebook task is run using all purpose compute in a workflow, so wondering if the poll loop only applies to SQL serverless compute?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2024 11:43:51 GMT</pubDate>
    <dc:creator>iamgoda</dc:creator>
    <dc:date>2024-07-12T11:43:51Z</dc:date>
    <item>
      <title>Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78333#M35505</link>
      <description>&lt;P&gt;I am running a very simple SQL script within a notebook, using an X-Small SQL Serverless warehouse (that is already running). The execution time is different depending on how it's run:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;4s if run interactively (and through SQL editor)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;26s if run within a workflow as a notebook task&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If you look at the query history screenshot below you see the individual queries are taking the same amount of time to execute, but for some reason there's a few seconds delay between end of one query and start of the next query (line) when running through workflow vs interactively (both using SQL serverless warehouse). I tried both&amp;nbsp;&lt;STRONG&gt;current&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;preview&amp;nbsp;&lt;/STRONG&gt;channel and they both behave the same way&lt;/P&gt;&lt;P&gt;I even tried using an all purpose compute cluster (Single node: Standard_DS3_v2 · DBR: 15.3) and the times were consistent when running in a workflow vs interactively.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Script&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;declare or replace start_time timestamp = current_timestamp();
declare or replace end_time timestamp = current_timestamp();
declare or replace v STRUCT&amp;lt;SOURCE_TBL_MAX_TIMESTAMP STRING, TARGET_TBL_MAX_TIMESTAMP STRING, SOURCE_MAX_TIMESTAMP TIMESTAMP, TARGET_MAX_TIMESTAMP TIMESTAMP, MIN_TIME TIMESTAMP, MAX_TIME TIMESTAMP, MAX_INTERVAL_TIME TIMESTAMP, TABLE_SOURCE STRING, TABLE_TARGET STRING, MERGE_STATEMENT STRING, INTERVAL_COLUMN_NAME STRING, STAGING_TABLE_NAME STRING, STAGING_TABLE_CREATE_STATEMENT STRING, FULL_STAGING_TABLE_NAME STRING&amp;gt;;
select current_timestamp();
select v;
select current_timestamp();
select timestampdiff(MILLISECOND  , start_time, current_timestamp()) as total_time_elapsed_ms;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Screenshots&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="iamgoda_4-1720697910509.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/9468iECAB5BBD689F3BD7/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="iamgoda_4-1720697910509.png" alt="iamgoda_4-1720697910509.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="iamgoda_5-1720697937883.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/9469iB2E21CF3BA68A49E/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="iamgoda_5-1720697937883.png" alt="iamgoda_5-1720697937883.png" /&gt;&lt;/span&gt;&lt;P&gt;&lt;STRONG&gt;Query History&lt;/STRONG&gt;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="iamgoda_7-1720698691523.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/9471iF18FF398B585B243/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="iamgoda_7-1720698691523.png" alt="iamgoda_7-1720698691523.png" /&gt;&lt;/span&gt;&lt;P&gt;&lt;STRONG&gt;Further tests&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Using a SQL file workflow task, running on X-Small SQL serverless, the same script executes as expected (faster than notebook task):&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="iamgoda_0-1720701617441.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/9477i88D97BF3232E6DE5/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="iamgoda_0-1720701617441.png" alt="iamgoda_0-1720701617441.png" /&gt;&lt;/span&gt;&lt;P&gt;Not sure why the type of workflow task would impact the execution of the SQL script on a serverless warehouse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 11 Jul 2024 12:41:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78333#M35505</guid>
      <dc:creator>iamgoda</dc:creator>
      <dc:date>2024-07-11T12:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78334#M35506</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/82608"&gt;@SergeRielau&lt;/a&gt;&amp;nbsp;- is this another bug or?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 12:17:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78334#M35506</guid>
      <dc:creator>iamgoda</dc:creator>
      <dc:date>2024-07-11T12:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78405#M35517</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/92666"&gt;@iamgoda&lt;/a&gt;&amp;nbsp;No idea. In DBSQL session variables and their values must be preserved outside the runtime engine (since the session may be migrated), but that doesn't seem to be at play here (and it should not have such an impact).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 18:08:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78405#M35517</guid>
      <dc:creator>SergeRielau</dc:creator>
      <dc:date>2024-07-11T18:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78408#M35518</link>
      <description>&lt;P&gt;Yes and the fact that running it as a SQL script task works. Running it as a notebook task on a SQL serverless instance seems to be the issue.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 18:36:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78408#M35518</guid>
      <dc:creator>iamgoda</dc:creator>
      <dc:date>2024-07-11T18:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78481#M35536</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/92666"&gt;@iamgoda&lt;/a&gt;&amp;nbsp;&amp;nbsp;we are going to look into how to make this faster. There's a poll loop in Databricks Workflows for SQL notebooks (but not for SQL scripts) which causes things to slow down.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 08:41:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78481#M35536</guid>
      <dc:creator>BilalAslamDbrx</dc:creator>
      <dc:date>2024-07-12T08:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78511#M35545</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/29876"&gt;@BilalAslamDbrx&lt;/a&gt;&amp;nbsp;thanks for looking into this and confirming the issue. This doesn't happen if the SQL notebook task is run using all purpose compute in a workflow, so wondering if the poll loop only applies to SQL serverless compute?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 11:43:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78511#M35545</guid>
      <dc:creator>iamgoda</dc:creator>
      <dc:date>2024-07-12T11:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78549#M35554</link>
      <description>&lt;P&gt;This adds up. This particular polling inefficiency only applies to the flow of notebooks running on warehouses (not on clusters).&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 14:45:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/78549#M35554</guid>
      <dc:creator>BilalAslamDbrx</dc:creator>
      <dc:date>2024-07-12T14:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/79401#M35751</link>
      <description>&lt;P&gt;Any idea of whether this will be addressed and when?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 11:35:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/79401#M35751</guid>
      <dc:creator>iamgoda</dc:creator>
      <dc:date>2024-07-19T11:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/79558#M35781</link>
      <description>&lt;P&gt;No not yet&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 15:16:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/79558#M35781</guid>
      <dc:creator>BilalAslamDbrx</dc:creator>
      <dc:date>2024-07-20T15:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/93742#M38754</link>
      <description>&lt;P&gt;Hello. Are there updates for this issue?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2024 20:56:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/93742#M38754</guid>
      <dc:creator>Ememel</dc:creator>
      <dc:date>2024-10-13T20:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/94295#M38859</link>
      <description>&lt;P&gt;I was told that it would be fixed in Q4 this year. I am checking for an update again and will let you know if they give me a more exact date.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 13:39:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/94295#M38859</guid>
      <dc:creator>iamgoce</dc:creator>
      <dc:date>2024-10-16T13:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/96568#M39294</link>
      <description>&lt;P&gt;So I was told that the Q4 date was incorrect - in fact there is currently no ETA for when this issue will be fixed. It's considered lower priority by Databricks as not enough customers are impacted or have raised this type of an issue. I would recommend&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/126515"&gt;@Ememel&lt;/a&gt;&amp;nbsp;that you try and raise this issue through your Databricks support team or Microsoft so it increases the priority?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2024 18:50:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/96568#M39294</guid>
      <dc:creator>iamgoce</dc:creator>
      <dc:date>2024-10-28T18:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/105562#M42184</link>
      <description>&lt;P&gt;I'm facing the exact same issue - when ran as an SQL Notebook it runs in 40 seconds, the same Notebook as a job on a serverless sql arehouse&lt;/P&gt;&lt;P&gt;There just seems to be gaps of a good number of seconds between each statement when ran as a job.&lt;/P&gt;&lt;P&gt;Severless SQL warehouse takes ~2 minutes.&lt;/P&gt;&lt;P&gt;(I also tried running this on a serverless cluster and it was ~2 minutes, but I can't see the breakdown of statements in the job when I did that)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 12:25:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/105562#M42184</guid>
      <dc:creator>LordAsp</dc:creator>
      <dc:date>2025-01-14T12:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/105568#M42185</link>
      <description>&lt;P&gt;Yeah I don't think it's been fixed yet or is even on the roadmap to be fixed. Databricks can't prioritize fixing this bug until enough users report it. So if you can, report the issue directly with your Databricks account team.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 12:41:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/105568#M42185</guid>
      <dc:creator>iamgoce</dc:creator>
      <dc:date>2025-01-14T12:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/105570#M42186</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LordAsp_0-1736858519166.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/14085i171F28CC4B9FE464/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LordAsp_0-1736858519166.png" alt="LordAsp_0-1736858519166.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now remember to attached the file &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;BR /&gt;Made a job with the same task 3 times, first 2 times as dbquery.ipynb (first to ensure&amp;nbsp;&lt;SPAN&gt;Serverless Starter Warehouse awake) and then last time as a .sql file (exact same code)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 12:43:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/105570#M42186</guid>
      <dc:creator>LordAsp</dc:creator>
      <dc:date>2025-01-14T12:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL script slow execution in workflows using serverless</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/105572#M42188</link>
      <description>&lt;P&gt;It'll certainly be more of a bother for us to stick to .sql files (as databricks seems to push you to dbquery.ipynb stuff) so I'll find out who our account team is, and ask them to raise it as well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 12:50:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-script-slow-execution-in-workflows-using/m-p/105572#M42188</guid>
      <dc:creator>LordAsp</dc:creator>
      <dc:date>2025-01-14T12:50:24Z</dc:date>
    </item>
  </channel>
</rss>

