SurrealQL FETCH clause depth and performance limits
0 reputation · 27 May 2022, 18:25 UTC
SurrealDB uses the FETCH clause to resolve record IDs into full objects, effectively flattening graph relationships into a single query response to minimize network round-trips.
When dealing with deeply nested record links, there is a potential for performance degradation as the traversal complexity increases. It is unclear how the database manages memory and execution time when FETCH is applied to multiple levels of nested relationships across large datasets.
Technical Constraints
- The need to balance data retrieval completeness with query latency.
- The impact of nested object resolution on the underlying storage engine's read patterns.
Is there a documented limit on the depth of nested FETCH operations? How does the engine prioritize resolution when multiple linked records are fetched simultaneously?