3 ms·
Recursive CTE can be very fast in Postgres. I can create a closure table of 2 Million rows for indirect and direct relations i.e. All paths from 15000 source di
by garyclarke27 11y ago
Recursive CTE can be very fast in Postgres.
I can create a closure table of 2 Million rows for indirect and direct relations i.e. All paths from 15000 source direct relations in about 12 seconds on my MBPro 1Tb ssd 16 Ram.
The makes it practical to just recreate all paths as a materialzed view refresh instead of worring about complicated incremental graph logic such as moving branches.
With such a closure view - any graph traversal query is lightning fast - no need for neo4j !
- ajw0100 11y agoCan you post the code for this somewhere? Thanks!