<?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 Optimize table for joins using identity column in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/optimize-table-for-joins-using-identity-column/m-p/48698#M28362</link>
    <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to the delta table format so please bear with me if I've missed something obvious! I've migrated data from on prem. Sql to fabric and stored two related tables as delta tables. When I query data from these tables and join them based on a related key the query takes a significant amount of time. Ie 60 seconds for a limit 1000 sql query. Table 1 has c. 6m rows table 2 maybe 1m. The data types are currently string but I can change this to integer should it help. The keys are integers from sql but I've stored them as string format for now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is them being a string hindering performance or should I employ an optimisation technique such as Z ordering? (I have tried Z ordering but it has no impact on the files.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using pyspark in a notebook in ms fabric which I understand runs delta 2.3. I believe later versions (those on databricks) also support an auto incrementing identity column which isn't in place here.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 08 Oct 2023 18:43:10 GMT</pubDate>
    <dc:creator>LiamS</dc:creator>
    <dc:date>2023-10-08T18:43:10Z</dc:date>
    <item>
      <title>Optimize table for joins using identity column</title>
      <link>https://community.databricks.com/t5/data-engineering/optimize-table-for-joins-using-identity-column/m-p/48698#M28362</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to the delta table format so please bear with me if I've missed something obvious! I've migrated data from on prem. Sql to fabric and stored two related tables as delta tables. When I query data from these tables and join them based on a related key the query takes a significant amount of time. Ie 60 seconds for a limit 1000 sql query. Table 1 has c. 6m rows table 2 maybe 1m. The data types are currently string but I can change this to integer should it help. The keys are integers from sql but I've stored them as string format for now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is them being a string hindering performance or should I employ an optimisation technique such as Z ordering? (I have tried Z ordering but it has no impact on the files.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using pyspark in a notebook in ms fabric which I understand runs delta 2.3. I believe later versions (those on databricks) also support an auto incrementing identity column which isn't in place here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2023 18:43:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/optimize-table-for-joins-using-identity-column/m-p/48698#M28362</guid>
      <dc:creator>LiamS</dc:creator>
      <dc:date>2023-10-08T18:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize table for joins using identity column</title>
      <link>https://community.databricks.com/t5/data-engineering/optimize-table-for-joins-using-identity-column/m-p/50733#M28878</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You mentioned that you have tried Z-ordering but it didn't impact the performance. Z-ordering is a technique that co-locates related information in the same set of files. It works best when the data is filtered by the column specified in the Z-ordering. If your queries are not filtering on the Z-ordered column, you might not see a significant performance improvement.&lt;BR /&gt;&lt;A href="https://docs.databricks.com/en/delta/data-skipping.html" target="_blank"&gt;https://docs.databricks.com/en/delta/data-skipping.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.databricks.com/blog/2020/05/29/adaptive-query-execution-speeding-up-spark-sql-at-runtime.html" target="_blank"&gt;https://www.databricks.com/blog/2020/05/29/adaptive-query-execution-speeding-up-spark-sql-at-runtime.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.databricks.com/blog/2020/04/30/faster-sql-queries-on-delta-lake-with-dynamic-file-pruning.html" target="_blank"&gt;https://www.databricks.com/blog/2020/04/30/faster-sql-queries-on-delta-lake-with-dynamic-file-pruning.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 10:51:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/optimize-table-for-joins-using-identity-column/m-p/50733#M28878</guid>
      <dc:creator>Sidhant07</dc:creator>
      <dc:date>2023-11-09T10:51:35Z</dc:date>
    </item>
  </channel>
</rss>

