<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>B-Tree on Nalar</title>
    <link>https://nalar.dev/tags/b-tree/</link>
    <description>Recent content in B-Tree on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 16 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/b-tree/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>PostgreSQL B-Tree Deduplication Compresses Duplicate Keys</title>
      <link>https://nalar.dev/postgresql-btree-deduplication-compresses-duplicate-keys/</link>
      <pubDate>Wed, 16 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/postgresql-btree-deduplication-compresses-duplicate-keys/</guid>
      <description>&lt;p&gt;A PostgreSQL B-tree leaf page can hold many index tuples with identical key values. When deduplication is applicable, PostgreSQL can represent a group of those tuples as one posting-list tuple: the indexed key appears once, followed by a sorted array of heap tuple identifiers.&lt;/p&gt;&#xA;&lt;p&gt;This representation changes physical index density without changing the logical set of index entries. Each heap tuple remains individually addressable through its TID, while repeated key material occupies less leaf-page space.&lt;/p&gt;</description>
    </item>
    <item>
      <title>PostgreSQL B-Tree Fillfactor Reserves Space Before Page Splits</title>
      <link>https://nalar.dev/postgresql-btree-fillfactor-reserves-space-before-page-splits/</link>
      <pubDate>Tue, 15 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/postgresql-btree-fillfactor-reserves-space-before-page-splits/</guid>
      <description>&lt;p&gt;A PostgreSQL B-tree leaf page has finite space for index tuples. When an incoming tuple belongs on a page that no longer has room, the access method must make space, and a page split can add another leaf page plus a new parent downlink. The &lt;code&gt;fillfactor&lt;/code&gt; storage parameter controls how tightly leaf pages are packed at selected points in the index lifecycle, leaving capacity that later writes can consume.&lt;/p&gt;&#xA;&lt;p&gt;For B-tree indexes, PostgreSQL uses a default fillfactor of 90. A value below 100 deliberately exchanges denser initial storage for free space on leaf pages. That space is not a permanent reservation for a particular row or key. It is simply unused page capacity available to later index activity.&lt;/p&gt;</description>
    </item>
    <item>
      <title>PostgreSQL B-Tree Skip Scan Repositions Index Searches</title>
      <link>https://nalar.dev/postgresql-btree-skip-scan-repositions-index-searches/</link>
      <pubDate>Tue, 15 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/postgresql-btree-skip-scan-repositions-index-searches/</guid>
      <description>&lt;p&gt;A multicolumn B-tree does not always require an equality condition on its first column to avoid reading the entire index. PostgreSQL can use skip scan to perform repeated targeted searches when a predicate constrains a later column and the planner estimates that repositioning will bypass enough index entries.&lt;/p&gt;&#xA;&lt;p&gt;Consider an index whose key order is &lt;code&gt;(region, created_at)&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div&#xA;  x-data=&#34;{ code: $el.querySelector(&#39;code&#39;).innerText, copied: false }&#34;&#xA;  class=&#34;code-block group relative my-6 overflow-hidden rounded-xl border border-line bg-surface-muted dark:border-night-line dark:bg-night-surface&#34;&gt;&#xA;  &lt;button&#xA;    type=&#34;button&#34;&#xA;    @click=&#34;navigator.clipboard.writeText(code); copied = true; setTimeout(() =&gt; copied = false, 1600)&#34;&#xA;    class=&#34;absolute right-3 top-3 z-10 rounded-lg border border-line-strong bg-surface px-2 py-1 font-mono text-[0.65rem] text-muted opacity-0 transition group-hover:opacity-100 hover:bg-ink hover:text-white dark:border-night-line dark:bg-night dark:text-night-muted dark:hover:bg-white dark:hover:text-ink&#34;&gt;&#xA;    &lt;span x-text=&#34;copied ? &#39;Copied&#39; : &#39;Copy&#39;&#34;&gt;&lt;/span&gt;&#xA;  &lt;/button&gt;&#xA;  &#xA;  &lt;div class=&#34;overflow-x-auto p-4 text-sm leading-6 [&amp;_pre]:!m-0 [&amp;_pre]:!bg-transparent [&amp;_pre]:!p-0 [&amp;_code]:font-mono&#34;&gt;&#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;font-weight:bold&#34;&gt;CREATE&lt;/span&gt; &lt;span style=&#34;font-weight:bold&#34;&gt;INDEX&lt;/span&gt; orders_region_created_at_idx&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;font-weight:bold&#34;&gt;ON&lt;/span&gt; orders (region, created_at);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;  &lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;A query that filters only &lt;code&gt;created_at&lt;/code&gt; has no explicit condition on &lt;code&gt;region&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>PostgreSQL B-Tree Deduplication Packs Duplicate Keys</title>
      <link>https://nalar.dev/postgresql-btree-deduplication-packs-duplicate-keys/</link>
      <pubDate>Mon, 14 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/postgresql-btree-deduplication-packs-duplicate-keys/</guid>
      <description>&lt;p&gt;A PostgreSQL B-tree can represent several equal index keys with one physical key value followed by multiple heap tuple identifiers. This representation, called a posting-list tuple, reduces repeated key storage on leaf pages without changing the logical contents of the index.&lt;/p&gt;&#xA;&lt;p&gt;The mechanism matters most when an indexed value occurs many times. An index on a low-cardinality status column, for example, may contain thousands of entries whose key is &lt;code&gt;pending&lt;/code&gt;. Logically those entries still identify separate table tuples. Physically, B-tree deduplication can pack groups of equal keys so the key datum is stored once for a group of TIDs.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
