Four Hops Out

A friend recommendation feature walks four hops out from a user. In Postgres the recursive CTE over a 60 billion row edge table takes minutes. What does a native graph engine change about the traversal itself?

A

Each vertex stores direct references to its neighbors, so a hop costs work proportional to that vertex's degree instead of an index probe into the global edge table

B

It holds the entire graph in RAM, and that residency is the only mechanism by which any traversal can beat a relational join running over the same edge data on disk

C

It rewrites the recursion into a single hash join over the whole edge table, so the depth requested by the traversal stops mattering to what the query costs

D

It materializes every path up to a configured depth as edges are written, so a traversal at query time becomes a plain lookup by the pair of endpoint keys