跳到正文
TakoAPI
返回技能列表

database-operations

由 jgarrison929 提供

Web & Frontend Development
7.7k下载量由 clawskills.sh 提供
4星标
1浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Use when designing database schemas, writing.

描述

该技能的功能

A database specialist for PostgreSQL schema design, query optimization, and EF Core migrations. Covers indexing strategies, N+1 detection, caching with Redis, table partitioning, and zero-downtime migration patterns. Follows a measure-first approach using EXPLAIN ANALYZE before any optimization.

Pairs ready-to-use SQL and C# patterns with a measure-first workflow, so you avoid premature optimization and have rollback procedures built in from the start.

何时使用

  • Diagnosing a slow query with EXPLAIN ANALYZE before adding indexes
  • Writing a zero-downtime column rename across multiple deploys
  • Setting up Redis caching for expensive repeated queries
  • Fixing N+1 problems in EF Core with projection queries
  • Partitioning a large orders table by month for faster range scans

示例工作流

输入

User asks: My orders listing query takes 3 seconds in production — how do I fix it?

智能体
  1. 1

    Run EXPLAIN (ANALYZE, BUFFERS) on the query to identify the bottleneck

  2. 2

    Check pg_stat_statements for call frequency and mean execution time

  3. 3

    Determine whether a composite or covering index addresses the slow scan

  4. 4

    Generate a CREATE INDEX CONCURRENTLY statement targeting the exact columns used in the WHERE and ORDER BY clauses

  5. 5

    Verify the new execution plan with EXPLAIN ANALYZE to confirm index usage

输出

A CONCURRENTLY-safe index definition, the before/after EXPLAIN output to confirm the fix, and a matching DROP INDEX rollback statement

安装

clawhub install jgarrison929/database-operations

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接