Query optimisation: share initial snapshots across LIMIT variants of the same query (donor windows)
メンテナーはふだん 1 日以内に返信
@sprihaanand-juspay がすでに取り組んでいます。
2026年11月30日 から。
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- Rust
- スター
- 129
- フォーク
- 7
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
juspay/streamgres のほかの issue
-
Make the top-L client diff cost depend on what changed, not on the limit対応中かも @SahilKhan101 が 2 日前に担当しました。 オープンenhancement
juspay/streamgres#64 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1週間以上 初心者へのやさしさ 38/100
juspay/streamgres#56 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
juspay/streamgres#55 ·
メンテナーはふだん 1 日以内に返信
-
PgBouncer transaction pooling: `prepare` runs outside the read transaction and can land on another backend対応中かも @sprihaanand-juspay が 6 日前に担当しました。 オープン
juspay/streamgres#53 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
juspay/streamgres#49 ·
メンテナーはふだん 1 日以内に返信
juspay/streamgres の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Test connection's password prompt says the password is never saved, also for a keychain profileオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
area: settings bug Haiku review: no-score ui
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MMFoundation/WallpaperMachine#346 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rubys/roundhouse#2473 ·
-
bug mod: quantum info
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Qiskit/qiskit#17699 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信