Hacker News (AI keywords)Jun 7, 2026, 1:17 AMremywang

Passing DBs Through Continuations

Original: Passing DBs through continuations

A technical walkthrough of using CPS to fuse database query operators into efficient compiled loops.

The post explains how continuation-passing style can express database operators without materializing intermediate results. Using Prela and Julia examples, it shows list transformations, relational composition, product, scan, and probe being expanded through inlining. The result is modular query code that can compile into tight columnar loops, though the author notes assumptions around JIT cost and dense primary keys.

這篇文章是一篇偏系統程式與資料庫執行引擎的技術教學,主題不是 AI 模型,而是如何用 continuation-passing style(CPS)來實作資料庫查詢算子。作者先指出,若把 relational algebra 的 projection、filter、join 等操作寫成「吃 table、吐 table」的函式,雖然程式乾淨,但每個算子都會 materialize 中間結果,效能很差。傳統資料庫會用 iterator model 串流處理資料列,但每次呼叫 next 仍可能帶來 dynamic dispatch、vtable lookup 與 cache locality 問題;常見解法是 vectorization 或 query compilation,但這些都需要高度工程投入。

Full summary

Free shows the 3-line summary; Pro unlocks the full deep summary (~300 words) so you never have to click through.

See Pro plans →

Want the original English / full article?

Read on Hacker News (AI keywords) →

Summaries are AI-generated; the original article is authoritative.