qdrant-sliding-time-window
Skill này làm gì
Công cụ này giúp quản lý dữ liệu thay đổi theo thời gian, như bài đăng mạng xã hội hoặc tin tức. Nó đảm bảo chỉ thông tin gần đây mới nhanh và dễ tìm, còn dữ liệu cũ có thể truy cập chậm hơn hoặc bị xóa.
Khi nào nên dùng
- ✓Khi tôi muốn chỉ tìm các bài đăng gần đây trên mạng xã hội.
- ✓Khi tôi cần các bài báo cũ được tự động xóa.
- ✓Khi tôi muốn sắp xếp nhật ký hệ thống, chỉ giữ lại vài tháng gần nhất.
Liên kết skill
https://github.com/github/awesome-copilot/blob/main/skills/qdrant-scaling/scaling-data-volume/sliding-time-window/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Làm thế nào để tìm kiếm tin tức của tôi chỉ hiển thị bài báo trong tuần qua?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ tổ chức dữ liệu thành các 'cửa sổ' thời gian. Nó có thể chuyển dữ liệu cũ sang bộ lưu trữ chậm hơn hoặc xóa, đồng thời giữ dữ liệu gần đây luôn dễ truy cập nhanh.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Scaling with a Sliding Time Window
Use when only recent data needs fast search -- social media posts, news articles, support tickets, logs, job listings. Old data either becomes irrelevant or can tolerate slower access.
Three strategies: shard rotation (recommended), collection rotation (when per-period config differs), and filter-and-delete (simplest, for continuous cleanup).
Shard Rotation (Recommended)
Use when: data has natural time boundaries (daily, weekly, monthly). Preferred because queries span all time periods in one request without application-level fan-out. User-defined sharding
- Create a collection with user-defined sharding enabled
- Create one shard key per time period (e.g.,
2025-01,2025-02, ...,2025-06) - Ingest data into the current period's shard key
- When a new period starts, create a new shard key and redirect writes
- Delete the oldest shard key outside the retention window
- Deleting a shard key reclaims all resources instantly (no fragmentation, no optimizer overhead)
- Pre-create the next period's shard key before rotation to avoid write disruption
- Use
shard_key_selectorat query time to search only specific periods for efficiency - Shard keys can be placed on specific nodes for hot/cold tiering
Collection Rotation (Alias Swap)
Use when: you need per-period collection configuration (e.g., different quantization or storage settings). Collection aliases
- Create one collection per time period, point a write alias at the newest
- Query across all active collections in parallel, merge results client-side
- When a new period starts, create the new collection and swap the write alias Switch collection
- Drop the oldest collection outside the window
Trade-off vs shard rotation: allows per-collection config differences, but requires application-level fan-out and more operational overhead.
Filter-and-Delete
Use when: data arrives continuously without clear time boundaries, or you want the simplest setup.
- Store a
timestamppayload on every point, create a payload index on it Payload index - Filter to the desired window at query time using
rangecondition Range filter - Periodically delete expired points using delete-by-filter Delete points
- Run cleanup during off-peak hours in batches (10k-50k points) to avoid optimizer locks
- Deletes are not free: tombstoned points degrade search until optimizer compacts segments
- Does not reclaim disk instantly (compaction is asynchronous)
Hot/Cold Tiers
Use when: recent data needs fast in-RAM search, older data should remain searchable at lower performance.
- Shard rotation: place current shard key on fast-storage nodes, move older shard keys to cheaper nodes via shard placement. All queries still go through a single collection.
- Collection rotation: keep current collection in RAM (
always_ram: true), move older collections to mmap/on-disk vectors. Quantization
What NOT to Do
- Do not use filter-and-delete for high-volume time-series with millions of daily deletes (use rotation instead)
- Do not forget to index the timestamp field (range filters without an index cause full scans)
- Do not use collection rotation when shard rotation would suffice (unnecessary fan-out complexity)
- Do not drop a shard key or collection before verifying its period is fully outside the retention window
- Do not skip pre-creating the next period's shard key or collection (write failures during rotation are hard to recover)
Câu hỏi thường gặp
Cách tốt nhất để tổ chức dữ liệu theo thời gian là gì?
Xoay vòng shard (shard rotation) thường được khuyến nghị vì cho phép tìm kiếm nhanh trên mọi khoảng thời gian mà không phức tạp thêm.
Điều gì xảy ra với dữ liệu cũ?
Dữ liệu có thể được chuyển sang bộ lưu trữ chậm hơn hoặc xóa hoàn toàn, tùy nhu cầu của bạn.
Xóa dữ liệu cũ có an toàn không?
Có, công cụ cung cấp các phương pháp xóa dữ liệu cũ an toàn, đảm bảo thông tin quan trọng vẫn có thể truy cập.
Chi tiết
Mô tả gốc của tác giả
Guides sliding time window scaling in Qdrant. Use when someone asks 'only recent data matters', 'how to expire old vectors', 'time-based data rotation', 'delete old data efficiently', 'social media feed search', 'news search', 'log search with retention', or 'how to keep only last N months of data'.
repo: github/awesome-copilot
Độ phổ biến
- Sao GitHub
- 40k
- Vị trí xếp hạng
- #7367
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
acquire-codebase-knowledge
40kGiúp agent của bạn hiểu và ghi tài liệu cho một dự án mã nguồn có sẵn. Hữu ích khi đón thành viên mới hoặc nắm tổng quan về kiến trúc.
acreadiness-assess
40kGiúp agent của bạn đánh giá mức độ sẵn sàng cho AI của dự án và tạo báo cáo. Hữu ích để biết dự án đã sẵn sàng dùng công cụ AI đến đâu.
acreadiness-generate-instructions
40kGiúp agent của bạn tạo hướng dẫn cho công cụ AI dựa trên kết quả đánh giá. Hữu ích để cải thiện cách AI làm việc với mã và khắc phục các khoảng trống.
acreadiness-policy
40kGiúp agent của bạn xác định hoặc áp dụng chính sách đánh giá dự án bằng AI. Hữu ích để chuẩn hóa cách đánh giá dự án và đảm bảo tuân thủ.
Skill tương tự
discrawl
394kCho phép agent của bạn tìm kiếm và tóm tắt kho lưu trữ tin nhắn Discord trên máy, kiểm tra độ mới của dữ liệu và đọc tin nhắn trực tiếp.
clickhouse-io
280kGiúp agent của bạn tối ưu truy vấn và schema trong ClickHouse theo thực hành tốt nhất cho phân tích dữ liệu hiệu năng cao khi truy vấn chậm.
scientific-db-pubmed-database
280kGiúp agent của bạn tìm bài báo khoa học trong lĩnh vực y sinh. Hữu ích cho nghiên cứu cần thông tin y khoa cụ thể.