Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cursor prefetch with bounded lag #1149

Open
ale-dd opened this issue Apr 29, 2024 · 0 comments
Open

cursor prefetch with bounded lag #1149

ale-dd opened this issue Apr 29, 2024 · 0 comments

Comments

@ale-dd
Copy link

ale-dd commented Apr 29, 2024

EDIT: nvm, looks like there's really no mechanism in the pgwire protocol that would support this behavior.

Would it at all be possible to support prefetching a batch of up to N rows via a cursor, as compared to waiting for exactly N rows to be available?

In other words, I would like to have a max_lag parameter similar to timeout, but with different semantics. If after max_lag at least 1 row, yet less than prefetch rows are available, do return the available rows.

Current api is:

cursor(query, *args, prefetch=None, timeout=None, record_class=None)

I would like it to be augmented as:

cursor(query, *args, prefetch=None, max_lag=None, timeout=None, record_class=None)

Is there any intrinsic limitation that would make this not worth the effort or simply there has been no interest for anything like that?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant