MagicStack / MagicStack/asyncpg
cursor prefetch with bounded lag
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 8.1k
- Fork
- 469
- Merge medio
- 18m
- PR unite (30g)
- 4
Descrizione
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!
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia verificando la limitazione di pgwire indicata nell'issue e riesaminando l'API del cursore esistente descritta nel report. Non vengono indicati file o test e il comportamento richiesto potrebbe non essere implementabile; per completarlo sarebbero necessari un design confermato e supportato dal protocollo, nonché un ambito di progetto corrispondente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- postgresql, python
- Ambito
- backend-api-design, databases
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 15/100