今日已更新 119 条资讯 | 累计 20985 条内容
关于我们

Thinking in Graphs: A Cypher Crash Course for SQL Engineers | by Aayush Ostwal | Jun, 2026

/u/ostwal 2026年06月10日 18:24 3 次阅读 来源:Reddit r/programming

I've written SQL for over a decade. Joins, subqueries, recursive CTEs – the whole deal. Then I tried a graph database (Neo4j). And my relational muscle memory kept getting in the way. I kept trying to "map foreign keys" instead of just… traversing edges. So I built myself a side‑by‑side cheat sheet: SQL → Cypher for everything from basic SELECTs to variable‑length paths that would require recursive CTEs in PG/SQL Server. Turns out, queries like "users who bought this also bought…" go from 30 lines of self‑joins to 6 lines of zig‑zag pattern matching. If you've ever felt frustrated with: multi‑hop join performance LIKE '%...%' on string scans or just the sheer noise of mapping join tables for many‑to‑many …give this 5‑min read a shot. The mental shift alone (relationships as physical edges, not ID matching) changed how I model data – even when I go back to SQL. submitted by /u/ostwal [link] [留言]

本文内容来源于互联网,版权归原作者所有
查看原文