<?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 How often should I run OPTIMIZE on my Delta Tables? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-often-should-i-run-optimize-on-my-delta-tables/m-p/24389#M16935</link>
    <description>&lt;P&gt;I know it's important to periodically run Optimize on my Delta tables, but how often should I be doing this? Am I supposed to do this after every time I load data? &lt;/P&gt;</description>
    <pubDate>Tue, 15 Jun 2021 16:52:33 GMT</pubDate>
    <dc:creator>User16826992666</dc:creator>
    <dc:date>2021-06-15T16:52:33Z</dc:date>
    <item>
      <title>How often should I run OPTIMIZE on my Delta Tables?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-often-should-i-run-optimize-on-my-delta-tables/m-p/24389#M16935</link>
      <description>&lt;P&gt;I know it's important to periodically run Optimize on my Delta tables, but how often should I be doing this? Am I supposed to do this after every time I load data? &lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 16:52:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-often-should-i-run-optimize-on-my-delta-tables/m-p/24389#M16935</guid>
      <dc:creator>User16826992666</dc:creator>
      <dc:date>2021-06-15T16:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: How often should I run OPTIMIZE on my Delta Tables?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-often-should-i-run-optimize-on-my-delta-tables/m-p/24390#M16936</link>
      <description>&lt;P&gt;It would depend on how frequently you update the table and how often you read it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a daily ETL job updating a delta table, it might make sense to run OPTIMIZE at the end of it so that subsequent reads would benefit from the performance improvements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if  you have a streaming pipeline for e.g. appending data  to a delta table partitioned by day, you could enable delta.autoOptimize.optimizeWrite&amp;nbsp;=&amp;nbsp;true so that it attempts to write out 128 MB files for each table partition. You could have a separate job scheduled daily to run OPTIMIZE on all data excluding the current day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For e.g. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;OPTIMIZE events
WHERE date &amp;lt; current_timestamp() - INTERVAL 1 day
ZORDER BY (eventType)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Schedule OPTIMIZE jobs in a way so that it won't create conflicts with other concurrent writes and subsequent reads could benefit from the compaction and zordering &lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 23:02:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-often-should-i-run-optimize-on-my-delta-tables/m-p/24390#M16936</guid>
      <dc:creator>sajith_appukutt</dc:creator>
      <dc:date>2021-06-18T23:02:27Z</dc:date>
    </item>
  </channel>
</rss>

