<?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: Delta table size not shrinking after Vacuum in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/delta-table-size-not-shrinking-after-vacuum/m-p/135821#M50439</link>
    <description>&lt;P&gt;Hi, any update on this? Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 23 Oct 2025 10:59:35 GMT</pubDate>
    <dc:creator>pabloaschieri</dc:creator>
    <dc:date>2025-10-23T10:59:35Z</dc:date>
    <item>
      <title>Delta table size not shrinking after Vacuum</title>
      <link>https://community.databricks.com/t5/data-engineering/delta-table-size-not-shrinking-after-vacuum/m-p/65762#M32918</link>
      <description>&lt;P&gt;Hi team.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Everyday once we overwrite the last X month data in tables. So it generate a every day a larger amount of history. We don't use time travel so we don't need it.&lt;/P&gt;&lt;P&gt;What we done:&lt;/P&gt;&lt;PRE&gt;SET spark.databricks.delta.retentionDurationCheck.enabled = false&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;ALTER TABLE table_name SET TBLPROPERTIES ('delta.logRetentionDuration'='interval 48 HOURS', 'delta.deletedFileRetentionDuration'='interval 48 HOURS')&lt;/PRE&gt;&lt;P&gt;We run the following commands on delta tables&amp;nbsp; (full is table name)&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;" &amp;nbsp; OPTIMIZE,Vacuum"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; spark&lt;/SPAN&gt;&lt;SPAN&gt;.sql&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;REORG &lt;/SPAN&gt;&lt;SPAN&gt;TABLE&lt;/SPAN&gt;&lt;SPAN&gt; {} &lt;/SPAN&gt;&lt;SPAN&gt;APPLY&lt;/SPAN&gt;&lt;SPAN&gt; ( PURGE )&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;.format(full))&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; spark&lt;/SPAN&gt;&lt;SPAN&gt;.sql&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;OPTIMIZE {}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;.format(full))&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; spark&lt;/SPAN&gt;&lt;SPAN&gt;.sql&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;VACUUM {} RETAIN &lt;/SPAN&gt;&lt;SPAN&gt;48&lt;/SPAN&gt; &lt;SPAN&gt;HOURS&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;.format(full))&lt;/SPAN&gt;&lt;/PRE&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;After this in my understanding the will be only 48 hour history and the file size must be shrink.&amp;nbsp;&lt;BR /&gt;After run the history looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chrome_KZMxPl8x1d.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/6956i231DBEFEE0B3CD32/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="chrome_KZMxPl8x1d.png" alt="chrome_KZMxPl8x1d.png" /&gt;&lt;/span&gt;&lt;P&gt;The history stay as is and the file size is the same.&lt;BR /&gt;Can you provide me some additional information what i doing wrong, or i misunderstood the concept?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 08 Apr 2024 07:50:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/delta-table-size-not-shrinking-after-vacuum/m-p/65762#M32918</guid>
      <dc:creator>Spenyo</dc:creator>
      <dc:date>2024-04-08T07:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Delta table size not shrinking after Vacuum</title>
      <link>https://community.databricks.com/t5/data-engineering/delta-table-size-not-shrinking-after-vacuum/m-p/135821#M50439</link>
      <description>&lt;P&gt;Hi, any update on this? Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2025 10:59:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/delta-table-size-not-shrinking-after-vacuum/m-p/135821#M50439</guid>
      <dc:creator>pabloaschieri</dc:creator>
      <dc:date>2025-10-23T10:59:35Z</dc:date>
    </item>
  </channel>
</rss>

