Postgres Best Practices
作者: Supabase
来自 Supabase 的 Postgres 性能优化与最佳实践。在编写、审查或优化 Postgres 查询、模式设计或数据库配置时使用此技能。
npx skills add https://github.com/supabase/agent-skills --skill supabase-postgres-best-practicesSupabase Postgres Best Practices
Comprehensive performance optimization guide for Postgres, maintained by Supabase. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design.
When to Apply
Reference these guidelines when:
- Writing SQL queries or designing schemas
- Implementing indexes or query optimization
- Reviewing database performance issues
- Configuring connection pooling or scaling
- Optimizing for Postgres-specific features
- Working with Row-Level Security (RLS)
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Query Performance | CRITICAL | query- |
| 2 | Connection Management | CRITICAL | conn- |
| 3 | Security & RLS | CRITICAL | security- |
| 4 | Schema Design | HIGH | schema- |
| 5 | Concurrency & Locking | MEDIUM-HIGH | lock- |
| 6 | Data Access Patterns | MEDIUM | data- |
| 7 | Monitoring & Diagnostics | LOW-MEDIUM | monitor- |
| 8 | Advanced Features | LOW | advanced- |
How to Use
Read individual rule files for detailed explanations and SQL examples:
references/query-missing-indexes.md
references/query-partial-indexes.md
references/_sections.md
Each rule file contains:
- Brief explanation of why it matters
- Incorrect SQL example with explanation
- Correct SQL example with explanation
- Optional EXPLAIN output or metrics
- Additional context and references
- Supabase-specific notes (when applicable)
References
相关技能
sentry-setup-tracing
sentry
在任何项目中设置Sentry追踪(性能监控)。当被要求添加性能监控、启用追踪、跟踪事务/跨度时使用此功能,或…
official
langsmith-trace
langchain-ai
为LangChain/LangGraph应用添加追踪功能,并通过CLI查询追踪数据以进行调试和数据集生成。通过环境变量自动追踪LangChain/LangGraph应用;通过@traceable装饰器和wrap_openai()手动追踪Python和TypeScript中的其他框架。使用langsmith CLI查询追踪(完整执行树)或运行(单个节点),支持按时间、延迟、错误、标签和自定义元数据过滤。将追踪导出为保留层级结构的JSONL文件;...
official
write-spec
anthropic
根据问题陈述或功能想法编写功能规格或PRD。适用于将模糊的想法或用户请求转化为结构化文档、界定范围时…
official
system-design
anthropic
设计系统、服务和架构。通过“为……设计系统”、“我们应该如何架构”、“……的系统设计”、“什么是正确的架构……”来触发。
official
developing-genkit-js
firebase
使用Genkit流程、工具和多模型支持,构建AI驱动的Node.js/TypeScript应用程序。Genkit与提供商无关;通过插件支持Google AI、OpenAI、Anthropic、Ollama及其他LLM提供商。使用Zod定义类型安全的模式流程,执行生成请求,并在TypeScript中组合多步骤AI工作流。需要Genkit CLI v1.29.0及以上版本;近期主要API变更意味着您必须查阅genkit文档:read和common-errors.md以获取当前模式,而非依赖先前知识...
official
apply
launchdarkly
应用LaunchDarkly SDK接入:安装依赖(或双SDK组合),经同意后配置环境与密钥,在入口点添加初始化,验证编译。
official
azure-eventhub-ts
microsoft
使用 Azure Event Hubs SDK for JavaScript (@azure/event-hubs) 构建事件流应用程序。适用于实现高吞吐量事件引入、…
official
devx-ux
microsoft
开发者工具用户体验专家角色
official