/search-plan may over-fetch split metadata from PostgreSQL metastore on wide queries
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Theo dõi quickwit-search/src/root.rs search_plan qua quickwit-search/src/lib.rs list_relevant_splits và đường dẫn list_splits của metastore PostgreSQL. So sánh các trường cần cho /search-plan và /search với truy vấn split hiện tại, sau đó xác minh rằng các yêu cầu lập kế hoạch trên phạm vi rộng không còn lấy split_metadata_json mà vẫn trả về thông tin split cần thiết.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
We are routing through a proxy for guardrails, and before executing a /search query, we call /search-plan to determine whether the query is too heavy.
We observed that a small number of wide /<index>/search-plan requests can put noticeable CPU and read I/O pressure on the PostgreSQL metastore.
This may be related to how /search-plan currently uses the general-purpose list_splits metastore path. For PostgreSQL, that path appears to fetch full split rows, including split_metadata_json, even though the /search-plan response only needs split identifiers for searched_splits.
Environment
- Quickwit: e86f4fb9b21b97265698c92be66588e0725484e1
- Metastore backend: PostgreSQL (AWS Aurora PostgreSQL)
- Workload: low request rate, but some wide
/<index>/search-plancalls covering broad time ranges
Observed behavior
During the execution of /search-plan, the PostgreSQL Read Replica showed read-heavy load that was disproportionate to the request rate:
- DB CPU reached roughly 85–90%.
- Statement calls stayed in the single-digit calls/sec range.
- Active sessions were not saturated.
- Connection pool usage was low.
- Read throughput peaked around a few hundred MiB/s.
- Read IOPS peaked around tens of thousands per second.
- Returned/fetched tuples spiked sharply.
- Locks were mostly
AccessShareLock; no conflicts or deadlocks were observed.
This suggests the load is not caused by connection saturation, lock contention, or writes, but by a small number of read queries scanning and/or returning many rows.
As a mitigation we tried setting statement_timeout on the metastore connection, but it did not help: the heavy queries do not exceed the timeout, they simply do a lot of per-call work within it.
Suspected cause
/<index>/search-plan goes through the normal split planning path:
quickwit-search/src/root.rs—search_planquickwit-search/src/lib.rs—list_relevant_splits- PostgreSQL metastore —
list_splits
For PostgreSQL, list_splits builds a general-purpose split listing query and returns full split rows, including the large split_metadata_json TEXT column for every matched split. Each row is then JSON-deserialized into SplitMetadata on the Quickwit side.
The /search-plan response, however, only appears to use the split identifier from each split:
let split_ids = split_metadatas
.into_iter()
.map(|split| format!("{}/{}", split.index_uid.index_id, split.split_id))
.collect();
So for N matched splits, each /search-plan call appears to read and JSON-deserialize N full SplitMetadata values only to keep index_id and split_id from each. With wide queries (broad time range or * patterns) matching tens of thousands of splits, this is consistent with the read-heavy load we observed.
/<index>/search shares the same list_splits path. The downstream search code only uses a small number of scalar fields per split (index_uid, split_id, footer_offsets, time_range, num_docs), so a similar over-fetching shape likely applies there as well.
Possible improvement
Would it make sense to add a lightweight split listing path for planning-only use cases?
For /search-plan, the PostgreSQL metastore could avoid the general-purpose list_splits projection and fetch only the required identifiers, for example:
SELECT index_uid, split_id
FROM splits
WHERE ...
- Ngôn ngữ chính
- Rust
- Star
- 11.8k
- Fork
- 628
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 50
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quickwit-oss/quickwit
-
area:otel documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
quickwit-oss/quickwit#6686 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add some examples of requests in the REST API reference docsCó thể đã có người làm @Cunninger đã nhận 88 ngày trước. Đang mởenhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quickwit-oss/quickwit#4266 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
quickwit-oss/quickwit#3872 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update docs on range queriesĐang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
quickwit-oss/quickwit#3666 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
implement retry for ListTermsĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
quickwit-oss/quickwit#2769 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quickwit-oss/quickwit
Issue tương tự
-
p2 ready-mac
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
quickwit-oss/tantivy#3299 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`stream enable` fails with "already enabled" on every fresh session since streaming became always-onĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
vercel-labs/agent-browser#2797 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
witchesofthehill/manabrew#1309 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug help wanted ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
userFRM/egui-charts#4494 ·
Maintainer thường phản hồi trong vòng 1 ngày