|
|
|
|
|
by gwillen85
230 days ago
|
|
Great Question! The storage model is just regular SQLite tables. When you create a graph, it makes two backing tables:
my_graph_nodes -- id, labels (JSON array), properties (JSON object)
my_graph_edges -- id, source, target, edge_type, properties (JSON object)
It's an edge list, not adjacency lists. Query processing is not transpiling Cypher directly. There's a pipeline:
Cypher → AST → Logical Plan → Physical Plan (optimizer) → Iterators → SQL queries
The iterators generate SQL on-the-fly to fetch from those backing tables. Basically the Volcano model. graphFindEdgesByType is Actually deprecated and is a no-op now. The comment says "edge lookups are done via SQL queries." They used to have in-memory structures but moved to just generating SQL like:
SELECT e.target, e.id, e.edge_type
FROM my_graph_edges e
WHERE e.source = 123 AND e.edge_type = 'KNOWS' So it's "build SQL queries as needed during execution" rather than "transpile the whole Cypher query upfront." |
|