跳到正文
TakoAPI
返回技能列表

postgres-perf

由 kjaylee 提供

Coding Agents & IDEs
—暂无评分
你的评分

简介

PostgreSQL performance optimization and best practices.

描述

该技能的功能

A reference guide for PostgreSQL query optimization, schema design, connection management, and Row Level Security. Covers indexing strategies, N+1 query patterns, and concurrency best practices. Based on Supabase postgres-best-practices.

Combines query tuning, schema decisions, and connection pooling guidance in one place rather than spread across separate Postgres and Supabase docs.

何时使用

  • Diagnosing slow queries with EXPLAIN ANALYZE
  • Adding partial indexes for filtered queries
  • Replacing N+1 queries with JOINs
  • Configuring pgBouncer for serverless environments
  • Writing RLS policies without hurting performance

示例工作流

输入

User asks: why is my orders query slow on a 2M row table?

智能体
  1. 1

    Run EXPLAIN ANALYZE on the slow query to read the execution plan

  2. 2

    Identify Seq Scan on customer_email column

  3. 3

    Generate CREATE INDEX idx_orders_email ON orders(customer_email)

  4. 4

    Re-run EXPLAIN ANALYZE to confirm Index Scan is used

  5. 5

    Check if SELECT * can be narrowed to required columns only

输出

Index created, query switches from Seq Scan to Index Scan, execution time drops significantly

安装

clawhub install kjaylee/postgres-perf

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

链接