AllDotPy / AllDotPy/Ryx

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

Open
#56 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement ryx-backend ryx-python
Dominant language
Rust
Stars
13
Forks
5
Avg merge
1h 49m
Merged PRs (30d)
3

Description

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).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the current _stream_queryset generator and the ryx-backend executor that performs its LIMIT/OFFSET queries. Determine how named cursors and their required open transaction would fit the existing flow; done means streaming in chunks through server-side cursors for Postgres/MySQL without issuing new offset queries.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, postgres, python, rust
Domain
backend, databases, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.