Query optimisation: share initial snapshots across LIMIT variants of the same query (donor windows)
Maintainer antworten meist innerhalb von 1 Tag
@sprihaanand-juspay arbeitet bereits daran.
Seit 30.11.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Problem
Two subscriptions that differ only in LIMIT each issue their own
PostgreSQL snapshot read:
SELECT * FROM tickets WHERE status = 'OPEN'
ORDER BY created_at DESC, id ASC LIMIT 50; -- read LIMIT 100 → PG round-trip
SELECT * FROM tickets WHERE status = 'OPEN'
ORDER BY created_at DESC, id ASC LIMIT 20; -- read LIMIT 40 → PG round-trip (redundant)
The second read fetches rows the first already holds in memory. Today twin sharing only matches structurally identical queries (by_query is keyed on the full SingleTableReadQuery, which includes limit — src/model/query.rs), so LIMIT 20 and LIMIT 50 never meet.
Proposal
When a new subscription has the same table, filter, and ORDER BY as an existing one but a smaller limit, serve it from the existing subscription's held rows (share_rows) instead of reading storage again.
OPEN tickets LIMIT 50 → SELECT ... LIMIT 100 → PG round-trip
OPEN tickets LIMIT 20 → reuse the 50's rows → 0 PG reads
This is the donor model: registration-time only. After registration the child is independent — own Window, own frontier, own refills. The engine
already works this way for twins (shared row images via subscriber tags; per-sub window in windows: IdMap<SubId, Window>), so Phase 1 mostly relaxes the lookup.
- Vorherrschende Sprache
- Rust
- Sterne
- 129
- Forks
- 7
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 5
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus juspay/streamgres
-
Make the top-L client diff cost depend on what changed, not on the limitEvtl. vergeben @SahilKhan101 hat das vor 2 Tagen übernommen. Offenenhancement
juspay/streamgres#64 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 Über eine Woche Anfängerfreundlichkeit 38/100
juspay/streamgres#56 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
juspay/streamgres#55 ·
Maintainer antworten meist innerhalb von 1 Tag
-
PgBouncer transaction pooling: `prepare` runs outside the read transaction and can land on another backendEvtl. vergeben @sprihaanand-juspay hat das vor 6 Tagen übernommen. Offen
juspay/streamgres#53 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
juspay/streamgres#49 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in juspay/streamgres
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Test connection's password prompt says the password is never saved, also for a keychain profileOffenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
area: settings bug Haiku review: no-score ui
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
MMFoundation/WallpaperMachine#346 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
rubys/roundhouse#2473 ·
-
bug mod: quantum info
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Qiskit/qiskit#17699 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag