<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Query Planning on Nalar</title>
    <link>https://nalar.dev/tags/query-planning/</link>
    <description>Recent content in Query Planning on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 15 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/query-planning/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>PostgreSQL Extended Statistics Model Correlated Columns</title>
      <link>https://nalar.dev/postgresql-extended-statistics-model-correlated-columns/</link>
      <pubDate>Tue, 15 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/postgresql-extended-statistics-model-correlated-columns/</guid>
      <description>&lt;p&gt;PostgreSQL normally collects statistics for each column independently. That model works well when predicates on separate columns are close to independent, but it can misestimate row counts when the values move together.&lt;/p&gt;&#xA;&lt;p&gt;A table might store &lt;code&gt;country_code&lt;/code&gt; and &lt;code&gt;currency_code&lt;/code&gt;, for example. If most rows with &lt;code&gt;country_code = &#39;JP&#39;&lt;/code&gt; also have &lt;code&gt;currency_code = &#39;JPY&#39;&lt;/code&gt;, multiplying the two single-column selectivities treats a strong relationship as coincidence. The resulting cardinality estimate can be far below the actual row count.&lt;/p&gt;</description>
    </item>
    <item>
      <title>PostgreSQL CTE Materialization Controls Planner Boundaries</title>
      <link>https://nalar.dev/postgresql-cte-materialization-controls-planner-boundaries/</link>
      <pubDate>Mon, 14 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/postgresql-cte-materialization-controls-planner-boundaries/</guid>
      <description>&lt;p&gt;A PostgreSQL common table expression can either become part of the surrounding query plan or remain a separately computed result. That distinction changes more than plan shape. It controls whether restrictions can move across the CTE boundary and whether repeated references can cause repeated computation.&lt;/p&gt;&#xA;&lt;p&gt;Since PostgreSQL 12, a non-recursive, side-effect-free CTE is eligible for folding into its parent query. PostgreSQL normally folds such a CTE when the parent references it once. Multiple references normally lead to materialization instead. &lt;code&gt;MATERIALIZED&lt;/code&gt; and &lt;code&gt;NOT MATERIALIZED&lt;/code&gt; make that boundary explicit when the default does not fit the query.&lt;/p&gt;</description>
    </item>
    <item>
      <title>PostgreSQL Partial Indexes Focus Index Entries</title>
      <link>https://nalar.dev/postgresql-partial-indexes-focus-index-entries/</link>
      <pubDate>Mon, 14 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/postgresql-partial-indexes-focus-index-entries/</guid>
      <description>&lt;p&gt;A PostgreSQL index does not have to represent every row in its table. A partial index adds a predicate to the index definition, so only rows satisfying that predicate receive index entries. This changes both the physical scope of the index and the set of queries for which the planner can use it.&lt;/p&gt;&#xA;&lt;p&gt;The mechanism fits workloads where a stable subset of rows receives disproportionate query attention. An application might repeatedly inspect pending jobs while completed jobs remain mostly historical, or query active accounts while disabled accounts stay in the same table.&lt;/p&gt;</description>
    </item>
    <item>
      <title>PostgreSQL Partial Indexes Store Selected Rows</title>
      <link>https://nalar.dev/postgresql-partial-indexes-store-selected-rows/</link>
      <pubDate>Mon, 14 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/postgresql-partial-indexes-store-selected-rows/</guid>
      <description>&lt;p&gt;A PostgreSQL index does not have to represent every row in its table. A partial index adds a predicate to the index definition, and only rows satisfying that predicate receive index entries. The result is an index whose physical contents encode a condition about the table.&lt;/p&gt;&#xA;&lt;p&gt;That narrower scope changes both storage and planning behavior. Rows outside the predicate do not occupy entries in the index, but a query can use the index only when PostgreSQL can establish that the query condition implies the index predicate.&lt;/p&gt;</description>
    </item>
    <item>
      <title>PostgreSQL Partition Pruning Skips Unneeded Tables</title>
      <link>https://nalar.dev/postgresql-partition-pruning-skips-unneeded-tables/</link>
      <pubDate>Mon, 14 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/postgresql-partition-pruning-skips-unneeded-tables/</guid>
      <description>&lt;p&gt;A partitioned PostgreSQL table can represent many physical child tables behind one logical relation. A query against the parent does not necessarily scan every child. When a predicate conflicts with a partition&amp;rsquo;s bounds, PostgreSQL can remove that partition from the plan or execution path.&lt;/p&gt;&#xA;&lt;p&gt;This behavior is partition pruning. It depends on the partition key and partition bounds rather than an index on the key. The distinction matters because pruning decides which relations can be ignored before access methods inside the remaining relations become relevant.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
