Database Partition Manager 技能:检查 PostgreSQL 月度分区裁剪
EnglishClaude Code 安装步骤
- 从 GitHub 固定提交获取完整的 `plugins/database/database-partition-manager/skills/managing-database-partitions` 目录。
- 复制到目标项目的 `.claude/skills/`,确认 `.claude/skills/managing-database-partitions/SKILL.md`,再从项目根目录启动 Claude Code,输入 `/managing-database-partitions`。
中文摘要
用 Claude Code 依据常用日期查询设计范围分区,并通过本地 EXPLAIN 检查查询扫描哪些子表。
SKILL.md 中文导读
可复现示例
给 events 创建 1 月和 2 月两个分区,插入 1 月 31 日 23:59Z 与 2 月 1 日 00:00Z 两行。用大于等于 2 月 1 日且小于 3 月 1 日的条件查询。工作步骤
- 按 occurred_at 建立范围分区。约定起始边界含当天、结束边界不含当天。
- 分别插入两个边界附近的样例并执行单月范围查询。核对返回数据与 EXPLAIN 计划中的子表。
验收方法
2 月查询只返回第二条。执行计划可核对是否裁剪 1 月分区,边界行为清楚。
GitHub 原文 · 更新日期
适用环境
准备自己的 PostgreSQL 测试库和 psql。示例使用合成活动记录与按 UTC 月初定义的范围。
常见问题
可以用 BETWEEN 包含下个月的起始值吗?
按半开区间查询,避免下个月第一条数据落进本月报表。
相关指南
相关推荐
groq-install-auth 技能
jeremylongshore/claude-code-plugins-plus-skills
anima-common-errors 技能
jeremylongshore/claude-code-plugins-plus-skills
apple-notes-hello-world 技能
jeremylongshore/claude-code-plugins-plus-skills
castai-hello-world 技能
jeremylongshore/claude-code-plugins-plus-skills
cohere-local-dev-loop 技能
jeremylongshore/claude-code-plugins-plus-skills
figma-security-basics 技能
jeremylongshore/claude-code-plugins-plus-skills