I’ve seen mentions of “server-side cursors” in github and in the documentation Roadmap, but no details. Is there any information on this?
My objective is better pagination. This is such a common scenario that I think it deserves some direct attention (and the current RID-based or SKIP/LIMIT solutions are very poor for all but the simplest queries and smallest result sets).
Since I’m not sure of the implementation details of the “server-side cursors” that are mentioned, I don’t want to guess. But my thinking is that a “cursor” would be an ideal way to handle pagination. In my definition, a cursor would allow you to run a query and essentially save the state of that query at any point (maybe based on LIMIT), where part of the result set includes an opaque blob that can be used to continue to query later. Conceptually, the server should be able to pick up where it left off, just as if it hadn’t been interrupted. Of course the simplest version of this would be a forward-only cursor, which actually covers the majority of pagination use-cases, but potentially a bidirectional cursor could also be implemented in this way.