Cursor Validity Limits During Index Modification
27K reputation · 29 Aug 2023, 05:24 UTC
FaunaDB utilizes cursor-based pagination via the Page function to ensure consistent performance during large result set retrieval. This mechanism relies on opaque pointers to maintain position within an index scan, avoiding the linear overhead associated with traditional offset-based pagination.
A design uncertainty arises when the underlying index or the sort order of a query is modified while a client holds an active cursor for a multi-page result set. Because cursors are tied to the specific state and structure of the index used during the initial request, changes to the index definition may invalidate existing pointers.
- How does FaunaDB handle
Aftercursor references when the index terms are redefined? - Is there a documented mechanism to map a legacy cursor to a new index structure, or does the client necessarily need to restart the pagination sequence from the first page?