January 3, 2026
Make joins, not war
Worst Case Optimal Joins: Graph-Join Correspondence
Turning geeky joins into simple graph patterns — and the crowd has feelings
TLDR: The post translates complex SQL joins into simple graph patterns and shows triangle-finding with a cleaner Datalog style. The crowd split between hype and skepticism: graph fans cheered, SQL veterans demanded benchmarks, and everyone argued whether you need a graph database or just smarter joins.
Databases just went full detective board: this post maps old-school SQL joins (how tables connect) to graph patterns (think dots and lines), and even shows how to find triangles — three nodes all connected — with a cleaner Datalog style. The vibe? Graph folks are cheering, SQL lifers are rolling their eyes, and performance hawks are screaming, “Show me the benchmarks!” One commenter, eatonphil, dropped receipts that this is part of a series, which only fueled the binge-watch energy.
Fans love that “worst-case optimal joins” (a mouthful meaning a method designed to stay fast even in tough cases) makes joins feel like patterns you can see, not math you fear. The Datalog example using EAV triples (storing facts as tiny three-part entries) sparked a split: some called it cleaner, others roasted it as “hipster SQL.” Meanwhile, the triangle-hunting demo inspired memes like “Triangles in my database? More likely than you think.”
Drama peaked around whether you need a special graph database at all; a loud crew insists you can model graphs in regular SQL just fine, while graph DB fans say, “Try that at scale and call us back.” Another faction worried the self-join party means “your cloud bill will join too.” And when the author teased graph problems like vertex cover, half the thread had math class flashbacks — the other half asked for charts and numbers, now.
Key Points
- •Joins can be modeled as hypergraphs where variables are nodes and relations are edges.
- •Triangle finding in graphs can be implemented via SQL self-joins or as joins across three relations.
- •EDN Datalog expresses triangle queries with implicit equi-joins over EAV triple stores.
- •EAV-based systems commonly use index permutations (EAV, AEV, AVE) to support pattern matching.
- •Graph concepts like vertex cover translate to join properties (variables touching every relation).