Skip to content

feat: implement true server-side cursors for .stream() #56

@Einswilli

Description

@Einswilli

The current .stream() implementation relies on LIMIT/OFFSET chunking. While effective, this becomes slow for very large offsets and puts pressure on the database to re-scan results.

Goal: Implement true server-side cursors (using DECLARE CURSOR in Postgres/MySQL) to allow efficient streaming of millions of rows.

Implementation hint:

  1. Update the ryx-backend executor to support named cursors.
  2. Modify the _stream_queryset generator in Python to fetch from the cursor in chunks instead of issuing new LIMIT/OFFSET queries.
  3. Handle the transaction requirement (cursors usually require an open transaction).

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions