<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Optimizer on digitalitem: Claude skills library and product lab</title><link>https://digitalitem.online/en/tags/optimizer/</link><description>Recent content in Optimizer on digitalitem: Claude skills library and product lab</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 22 Oct 2026 10:10:00 +0000</lastBuildDate><atom:link href="https://digitalitem.online/en/tags/optimizer/index.xml" rel="self" type="application/rss+xml"/><item><title>Database Kernel (2): From Syntax Tree to Plan Tree — Filter Pushdown and Join Ordering</title><link>https://digitalitem.online/en/posts/plan-query-planning/</link><pubDate>Thu, 22 Oct 2026 10:10:00 +0000</pubDate><guid>https://digitalitem.online/en/posts/plan-query-planning/</guid><description>&lt;p&gt;Bind produces scopes and expressions; execution needs a &lt;strong&gt;plan tree&lt;/strong&gt;. The conversion in between decides whether a query merely runs or runs fast.&lt;/p&gt;
&lt;p&gt;This is part two of the &lt;a href="https://github.com/daviszhen/plan"&gt;plan&lt;/a&gt; series: how the plan tree is built, and the two optimizations that matter most.&lt;/p&gt;
&lt;h2 id="1-the-minimal-plan-node"&gt;1. The minimal plan node&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;type&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;LogicalOperator&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;struct&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;Typ&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;LOT&lt;/span&gt; &lt;span style="color:#75715e"&gt;// scan / filter / project / join / agg / order / limit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;Children&lt;/span&gt; []&lt;span style="color:#f92672"&gt;*&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;LogicalOperator&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;// node-specific extra fields&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Generation follows the bind order:&lt;/p&gt;</description></item><item><title>SignalBrief #1: Five Signals on Writing an Optimizer</title><link>https://digitalitem.online/en/posts/signalbrief-01/</link><pubDate>Tue, 20 Oct 2026 13:30:00 +0000</pubDate><guid>https://digitalitem.online/en/posts/signalbrief-01/</guid><description>&lt;blockquote&gt;
&lt;p&gt;SignalBrief is a weekly bilingual brief: one or two picks each from products, business and tech, with one line on why each matters.
This is issue #1. Subscribe at the bottom.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="1-a-1999-optimizer-that-still-compiles-today"&gt;1. A 1999 optimizer that still compiles today&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://digitalitem.online/en/posts/columbia-port/"&gt;Porting a 1999 Cascades optimizer to modern C++&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Why it matters: it proves a textbook implementation isn&amp;rsquo;t a museum piece. 19,787 lines, MFC-era, 17 .cpp files — it runs on a modern toolchain in a weekend, and then you can change it, break it and fix it. The fastest way to learn optimizers isn&amp;rsquo;t reading papers; it&amp;rsquo;s making a real one run on your machine.&lt;/p&gt;</description></item><item><title>gporca's Rule System: How to Read 119 Rules</title><link>https://digitalitem.online/en/posts/gporca-rules/</link><pubDate>Tue, 20 Oct 2026 13:10:00 +0000</pubDate><guid>https://digitalitem.online/en/posts/gporca-rules/</guid><description>&lt;p&gt;The previous post covered gporca&amp;rsquo;s DP cells. This one covers rules: &lt;code&gt;xforms/&lt;/code&gt; contains &lt;strong&gt;119 files, roughly 44K lines&lt;/strong&gt;. At first it looks like required reading — it isn&amp;rsquo;t. Rules are highly homogeneous; understanding three of them teaches you a whole class.&lt;/p&gt;
&lt;h2 id="1-there-are-only-three-kinds-of-rules"&gt;1. There are only three kinds of rules&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Kind&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;th&gt;Examples&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Transformation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Produce equivalent logical expressions inside the same group&lt;/td&gt;
&lt;td&gt;Join commutativity, associativity, predicate pushdown&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Implementation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Turn a logical expression into an executable physical operator&lt;/td&gt;
&lt;td&gt;HashJoin, IndexScan, Sort&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Enforcer&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Insert operators to satisfy parent requirements&lt;/td&gt;
&lt;td&gt;Sort (order), Motion (distribution)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Search works like this: transformations grow groups, implementations propose candidates, DP picks the cheapest per group.&lt;/p&gt;</description></item><item><title>The Optimizer's Cost Model: From Formulas to Calibrated Numbers</title><link>https://digitalitem.online/en/posts/optimizer-cost-model/</link><pubDate>Tue, 20 Oct 2026 13:05:00 +0000</pubDate><guid>https://digitalitem.online/en/posts/optimizer-cost-model/</guid><description>&lt;p&gt;The search space decides how many plans you can think of; the rules decide what shapes are reachable; and &lt;strong&gt;the cost model decides who wins&lt;/strong&gt;. Whether an optimizer is usable depends heavily on whether its cost model &amp;ldquo;makes sense&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;This post takes COLUMBIA&amp;rsquo;s cost model apart, plus the traps we hit when calibrating it on TPC-H.&lt;/p&gt;
&lt;h2 id="1-what-columbias-cost-model-looks-like"&gt;1. What COLUMBIA&amp;rsquo;s cost model looks like&lt;/h2&gt;
&lt;p&gt;Minimal: a cost model is &lt;strong&gt;a set of constants plus a local-cost formula per physical operator&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Writing a Query Optimizer: From COLUMBIA to TPC-H</title><link>https://digitalitem.online/en/posts/writing-a-query-optimizer/</link><pubDate>Tue, 20 Oct 2026 12:50:00 +0000</pubDate><guid>https://digitalitem.online/en/posts/writing-a-query-optimizer/</guid><description>&lt;p&gt;Query optimizers are the component everyone uses and few people write. You can recite Join Order, subquery unnesting and cost models in an interview — but actually writing an optimizer that survives all 22 TPC-H queries teaches you that the hard part isn&amp;rsquo;t the vocabulary. It&amp;rsquo;s the way the details constrain each other.&lt;/p&gt;
&lt;p&gt;This series is a record of one such attempt: from porting a textbook Cascades implementation, to making it digest TPC-H, to admitting the traps it fell into.&lt;/p&gt;</description></item><item><title>Reading gporca (Part 3): The Key of a DP Cell — (Group, Required Properties, Stage)</title><link>https://digitalitem.online/en/posts/gporca-dp-context/</link><pubDate>Tue, 20 Oct 2026 06:50:00 +0000</pubDate><guid>https://digitalitem.online/en/posts/gporca-dp-context/</guid><description>The optimization problem isn&amp;#39;t &amp;#39;find one optimal plan per group&amp;#39; — it&amp;#39;s &amp;#39;per (group, required properties, stage)&amp;#39;. COptimizationContext is the coordinate of that cell.</description></item><item><title>Reading gporca (Part 2): The Reference-Count Gate That Turns Recursive Search into a Pausable Task Network</title><link>https://digitalitem.online/en/posts/gporca-scheduler-refcount/</link><pubDate>Tue, 20 Oct 2026 06:40:00 +0000</pubDate><guid>https://digitalitem.online/en/posts/gporca-scheduler-refcount/</guid><description>gporca&amp;#39;s scheduler uses one counter and a set of state machines to flatten the entire recursive search into suspendable, resumable, deduplicated tasks.</description></item><item><title>Reading gporca (Part 1): Only ~11K of Its 400K Lines Are Actually Framework</title><link>https://digitalitem.online/en/posts/gporca-framework/</link><pubDate>Tue, 20 Oct 2026 06:30:00 +0000</pubDate><guid>https://digitalitem.online/en/posts/gporca-framework/</guid><description>Slicing gporca by &amp;#39;is this a framework design decision&amp;#39;: what each of its four libraries really is, the six mechanisms worth reading, and a practical reading order.</description></item><item><title>Six Real Traps in an Optimizer: Matching Results Don't Mean a Correct Plan</title><link>https://digitalitem.online/en/posts/optimizer-traps/</link><pubDate>Tue, 20 Oct 2026 06:20:00 +0000</pubDate><guid>https://digitalitem.online/en/posts/optimizer-traps/</guid><description>Semantic errors, memory overflows, ledger drift, and rule explosions: six traps from a TPC-H optimizer project, with how each was identified.</description></item><item><title>Making an Optimizer Run TPC-H: Lossless Conversion and Execution Reconciliation for 22 Queries</title><link>https://digitalitem.online/en/posts/tpch-lossless-and-execution/</link><pubDate>Tue, 20 Oct 2026 06:10:00 +0000</pubDate><guid>https://digitalitem.online/en/posts/tpch-lossless-and-execution/</guid><description>From 13/22 to 22/22: converting every TPC-H query as-is into the optimizer, checking lossless equivalence with DuckDB&amp;#39;s AST, and executing the resulting plans against the original queries.</description></item><item><title>Porting a 1999 Cascades Optimizer to Modern C++: The COLUMBIA Story</title><link>https://digitalitem.online/en/posts/columbia-port/</link><pubDate>Tue, 20 Oct 2026 06:00:00 +0000</pubDate><guid>https://digitalitem.online/en/posts/columbia-port/</guid><description>How a 19,787-line MFC optimizer from 1999 got rebuilt, debugged, and made to run its own test corpus — without MFC and without Windows.</description></item></channel></rss>