frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Anatomy of a SQL Engine

https://www.dolthub.com/blog/2025-04-25-sql-engine-anatomy/
168•ingve•7mo ago

Comments

jimbokun•7mo ago
Very nice write up enumerating all the stages of SQL query execution. Interesting even if you don’t care about the DoIt database specifically.
Austizzle•7mo ago
Man, this title tripped me up for a minute because I pronounce it with the letters like Ess-Queue-Ell

So the "A" in "A ess-queue-ell" engine felt like it should have been an "An" until I realized it was meant to be pronounced like "sequel"

perching_aix•7mo ago
Not necessarily, I see native speakers completely ignore this a lot.

Have you ever considered pronouncing it as squirrel by the way?

kreetx•7mo ago
Many (most?) non-native English speakers do pronounce it as ess-queue-ell, especially in their own languages, so yes, the use of "a" instead of "an" does look off from that perspective.
SloopJon•7mo ago
When I read SQL for Dummies almost thirty years ago, it made a point of distinguishing "sequel" as a historical predecessor to standard "SQL." As I recall, the author even asserted that SQL is not an acronym/initialism for structured query language. I felt funny saying sequel for the next decade or so, because I wasn't an old timer experienced with this pre-SQL technology.

Now I usually say sequel because everyone else does. That and it rolls off the tongue better than S-Q-L.

jtolmar•7mo ago
I prefer "ess queue ell" these days, but the first DBA I ever worked with pronounced it "squirrel".
gopalv•7mo ago
This is a great write up about a pull-style volcano SQL engine.

The IR I've used is the Calcite implementation, this looks very concept adjacent enough that it makes sense on the first read.

> tmp2/test-branch> explain plan select count() from xy join uv on x = u;

One of the helpful things we did was to build a graphviz dot export for the explains plans, which saved us days and years of work when trying to explain an optimization problem between the physical and logical layers.

My version would end up displayed as SVG like this

https://web.archive.org/web/20190724161156/http://people.apa...

But the calcite logical plans also have that dot export modes.

https://issues.apache.org/jira/browse/CALCITE-4197

th0ma5•7mo ago
This is really great!!
gavinray•7mo ago
Calcite also has a relatively-unknown web tool for plan visualization that lets you step through execution.

It's a method from "RuleMatchVisualizer":

https://github.com/apache/calcite/blob/36f6dddd894b8b79edeb5...

Here's a screenshot of what the webpage looks like, for anyone curious:

https://github.com/GavinRay97/GraphQLCalcite/blob/92b18a850d...

ignoreusernames•7mo ago
I recommend anyone who works with databases to write a simple engine. It's a lot simpler than you may think and it's a great exercise. If using python, sqlglot (https://github.com/tobymao/sqlglot) let's you skip all the parsing and it even does some simple optimizations. From the parsed query tree it's pretty straightforward to build a logical plan and execute that. You can even use python's builtin ast module to convert sql expressions into python ones (so no need for a custom interpreter!)
Abde-Notte•7mo ago
Second this - building even a simple engine gives real insight into query planning and execution. Once parsing is handled, the core ideas are a lot more approachable than they seem.
albert_e•7mo ago
Sorry for slight digression.

In a larger system we are building we need a text-to-sql capability for some structured data retrieval.

Is there a way one could utilize this library (sqlglot) to build a multi-dialect sql generator -- that is not currently solved by directly relying on a LLM that is better at code generation in general?

LtdJorge•7mo ago
This is a SQL to X library, though. I don’t think it’s what you need.
gavinray•7mo ago
You can use an LLM to generate query-builder expressions from popular libraries in whatever language.

For example, on the JVM there is jOOQ, which allows you to write something like:

  select(field("foo"), avg("bar")).from(table("todos"))
And then it will render dialect-specific SQL. It has very advanced emulation functionality for things like JSON aggregations and working around quirks of dialects.

Alternatively, you can ask an LLM to generate a specific dialect of SQL, and then use jOOQ to parse it to an AST, and then render it as a different dialect, like:

    val parser= DSL.using(SQLDialect.POSTGRES).parser()
    val parsedQuery = parser.parseQuery(postgresQuery)
    val renderedMySQL = DSL.using(SQLDialect.MYSQL).renderInlined(parsedQuery)
    println(renderedMySQL)
Unsure if functionality like this exists in other Query Builder libraries for other languages.
genai-analyst•7mo ago
another digression here... sorry... i see you're trying to diy text-to-sql—at some point you're gonna hit a bunch of hiccups. like, the model writes a query that “almost” works but joins the wrong tables, or it assumes column names that don’t exist, or it returns the wrong agg because it misread the intent. and retries won’t always save you—it’ll just confidently hallucinate again.

we’ve been through all of that at wobby.ai we ended up building a system where the data team defines guardrails and reusable query templates, so the agent doesn’t just make stuff up. it can still handle user prompts, but within a safe structure. if you want to save yourself from debugging this stuff endlessly, might be worth checking out wobby.ai.

KyleBrandt•7mo ago
Using dolthub's go-mysql-server for Grafana's upcoming SQL expressions feature (private preview in Grafana 12, but in the OSS version with a feature toggle).

GMS lets you provide your own table and database implementations, so we use GMS to perform SQL queries against Grafana's dataframes - so users can join or manipulate different data source queires, but we don't have to insert the data into SQL to do this thanks to GMS.

GPT-5.2

https://openai.com/index/introducing-gpt-5-2/
374•atgctg•2h ago•279 comments

Going Through Snowden Documents, Part 1

https://libroot.org/posts/going-through-snowden-documents-part-1/
92•libroot•1h ago•33 comments

My productivity app is a never-ending .txt file (2022)

https://jeffhuang.com/productivity_text_file/
32•simonebrunozzi•1h ago•9 comments

Litestream VFS

https://fly.io/blog/litestream-vfs/
113•emschwartz•2h ago•38 comments

The highest quality codebase

https://gricha.dev/blog/the-highest-quality-codebase
314•Gricha•2d ago•236 comments

Show HN: Sim – Apache-2.0 n8n alternative

https://github.com/simstudioai/sim
65•waleedlatif1•3h ago•11 comments

An SVG is all you need

https://jon.recoil.org/blog/2025/12/an-svg-is-all-you-need.html
23•sadiq•1h ago•7 comments

Craft software that makes people feel something

https://rapha.land/craft-software-that-makes-people-feel-something/
169•lukeio•6h ago•82 comments

Prove It All Night: With no fame or fortune, what keeps a band onstage? (1999)

https://chicagoreader.com/news/prove-it-all-night/
25•NaOH•1w ago•4 comments

Launch HN: BrowserBook (YC F24) – IDE for deterministic browser automation

49•cschlaepfer•5h ago•28 comments

An Orbital House of Cards: Frequent Megaconstellation Close Conjunctions

https://arxiv.org/abs/2512.09643
66•rapnie•5h ago•38 comments

Golang optimizations for high‑volume services

https://packagemain.tech/p/golang-optimizations-for-highvolume
18•der_gopher•3d ago•3 comments

Auto-grading decade-old Hacker News discussions with hindsight

https://karpathy.bearblog.dev/auto-grade-hn/
541•__rito__•1d ago•243 comments

Deprecate like you mean it

https://entropicthoughts.com/deprecate-like-you-mean-it
32•todsacerdoti•4h ago•80 comments

Things I want to say to my boss

https://www.ithoughtaboutthatalot.com/2025/the-things-i-want-to-say-to-my-boss
193•casca•3h ago•163 comments

Getting a Gemini API key is an exercise in frustration

https://ankursethi.com/blog/gemini-api-key-frustration/
778•speckx•1d ago•300 comments

Patterns.dev

https://www.patterns.dev/
525•handfuloflight•19h ago•121 comments

Show HN: Local Privacy Firewall-blocks PII and secrets before ChatGPT sees them

https://github.com/privacyshield-ai/privacy-firewall
87•arnabkarsarkar•2d ago•36 comments

EFF launches Age Verification Hub

https://www.eff.org/press/releases/eff-launches-age-verification-hub-resource-against-misguided-laws
126•iamnothere•23h ago•78 comments

Helldivers 2 on-disk size 85% reduction

https://store.steampowered.com/news/app/553850/view/491583942944621371
215•SergeAx•1w ago•202 comments

Days since last GitHub incident

https://github-incidents.pages.dev/
170•AquiGorka•3h ago•96 comments

Kicking Robots

https://harpers.org/archive/2025/12/kicking-robots-james-vincent-humanoids/
25•Hooke•4d ago•4 comments

Show HN: An endless scrolling word search game

https://endless-wordsearch.com
6•marcusdev•6h ago•6 comments

A “frozen” dictionary for Python

https://lwn.net/SubscriberLink/1047238/25c270b077849dc0/
175•jwilk•10h ago•129 comments

Oldest attestation of Austronesian language: Đông Yên Châu inscription

https://en.wikipedia.org/wiki/%C4%90%C3%B4ng_Y%C3%AAn_Ch%C3%A2u_inscription
57•teleforce•5d ago•17 comments

The Cost of a Closure in C

https://thephd.dev/the-cost-of-a-closure-in-c-c2y
172•ingve•13h ago•68 comments

Show HN: GPULlama3.java Llama Compilied to PTX/OpenCL Now Integrated in Quarkus

17•mikepapadim•4h ago•1 comments

Pop_OS 24.04 LTS with COSMIC desktop environment

https://blog.system76.com/post/pop-os-letter-from-our-founder/
83•onnnon•1h ago•26 comments

Size of Life

https://neal.fun/size-of-life/
2430•eatonphil•1d ago•271 comments

Rivian Unveils Custom Silicon, R2 Lidar Roadmap, and Universal Hands Free

https://riviantrackr.com/news/rivian-unveils-custom-silicon-r2-lidar-roadmap-universal-hands-free...
87•doctoboggan•2h ago•116 comments