Tested two potential optimizations based on a comment on the TypeGraph post in /r/postgresql from u/Deep_Ad1959:
- Native
CYCLEclause vs the manualARRAY[]+!= ALL(path)cycle detection that TypeGraph currently emits (packages/typegraph/src/query/dialect/postgres.ts:178-192). - Prepared-statement plan caching can pick a bad generic plan after
the 5th execution under
plan_cache_mode = autowhen start-node selectivity varies widely.