返回技能列表

qdrant-sliding-time-window

qdrant
更新于 5 days ago
154
18
154
在 GitHub 上查看
设计designdata

关于

This skill provides strategies for implementing sliding time window data management in Qdrant, ideal for scenarios like social media feeds or log search where only recent data needs fast access. It recommends three approaches: shard rotation (preferred for query efficiency), collection rotation, and filter-and-delete for continuous cleanup. Use it when developers need to efficiently expire old vectors while maintaining performant search on current data.

快速安装

Claude Code

推荐
主要方式
npx skills add qdrant/skills -a claude-code
插件命令备选方式
/plugin add https://github.com/qdrant/skills
Git 克隆备选方式
git clone https://github.com/qdrant/skills.git ~/.claude/skills/qdrant-sliding-time-window

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

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

  1. Create a collection with user-defined sharding enabled
  2. Create one shard key per time period (e.g., 2025-01, 2025-02, ..., 2025-06)
  3. Ingest data into the current period's shard key
  4. When a new period starts, create a new shard key and redirect writes
  5. 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_selector at 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

  1. Create one collection per time period, point a write alias at the newest
  2. Query across all active collections in parallel, merge results client-side
  3. When a new period starts, create the new collection and swap the write alias Switch collection
  4. 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.

  1. Store a timestamp payload on every point, create a payload index on it Payload index
  2. Filter to the desired window at query time using range condition Range filter
  3. 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)

GitHub 仓库

qdrant/skills
路径: skills/qdrant-scaling/scaling-data-volume/sliding-time-window
0
agent-skillsai-agentsclaude-codecodexcursorembeddings

相关推荐技能

executing-plans

设计

该Skill用于当开发者提供完整实施计划时,以受控批次方式执行代码实现。它会先审阅计划并提出疑问,然后分批次执行任务(默认每批3个任务),并在批次间暂停等待审查。关键特性包括分批次执行、内置检查点和架构师审查机制,确保复杂系统实现的可控性。

查看技能

requesting-code-review

设计

该Skill可在完成任务、实现主要功能或合并代码前自动调度代码审查子代理,确保实现符合需求和计划。它支持通过指定git SHA范围进行精准的代码变更审查,帮助开发者在关键节点及时发现潜在问题。核心原则是"早审查、勤审查",适用于开发流程的各个关键阶段。

查看技能

connect-mcp-server

设计

这个Skill指导开发者如何将MCP服务器连接到Claude Code,支持HTTP、stdio和SSE三种传输协议。它涵盖了从安装配置到认证安全的完整流程,适用于集成GitHub、Notion、数据库等外部服务。当开发者需要添加集成、配置外部工具或提及MCP相关功能时,这个Skill能提供实用的操作指南。

查看技能

web-cli-teleport

设计

该Skill帮助开发者根据任务特性选择Claude Code的Web或CLI界面,并指导如何在两种环境间无缝迁移会话。它能分析任务复杂度、迭代需求等要素,推荐最优工作界面和工作流。关键特性包括会话状态管理、环境切换指导和上下文优化建议。

查看技能