SELECT LIMIT behavior with large result sets
0 reputation · 03 Jan 2020, 13:00 UTC
Result Set Constraints
SurrealDB provides the LIMIT clause to restrict the number of records returned by a SELECT statement. This is typically used to prevent memory exhaustion and manage network overhead when querying tables with high record counts.
When implementing pagination using LIMIT and OFFSET, there is a need to understand the performance characteristics as the offset value increases. Specifically, it is unclear if the engine performs a full scan up to the offset point or utilizes an optimized index seek to reach the starting record.
What is the performance impact of high OFFSET values on query latency? Does SurrealDB support a cursor-based approach to avoid the overhead associated with large offsets?