Postgres Best Practices

bởi Supabase

Tối ưu hóa hiệu suất Postgres và các phương pháp hay nhất từ Supabase. Sử dụng kỹ năng này khi viết, xem xét hoặc tối ưu hóa các truy vấn Postgres, thiết kế lược đồ hoặc cấu hình cơ sở dữ liệu.

npx skills add https://github.com/supabase/agent-skills --skill supabase-postgres-best-practices

Supabase 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

PriorityCategoryImpactPrefix
1Query PerformanceCRITICALquery-
2Connection ManagementCRITICALconn-
3Security & RLSCRITICALsecurity-
4Schema DesignHIGHschema-
5Concurrency & LockingMEDIUM-HIGHlock-
6Data Access PatternsMEDIUMdata-
7Monitoring & DiagnosticsLOW-MEDIUMmonitor-
8Advanced FeaturesLOWadvanced-

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

Skills liên quan

powerbi-report-design
microsoft
Generate Power BI report visual design guidance before PBIR files are written. Use when the user wants to: (1) choose tone, signature, page archetypes, chart…
official
vpc-air-gapped
rivet-dev
Run Rivet entirely inside your own perimeter: single-binary or Docker Compose install, file system storage with no database infrastructure, and no outbound…
official
land
openai
Hạ cánh một PR bằng cách theo dõi xung đột, giải quyết chúng, chờ kiểm tra, và
official
feature-planner
coinbase
Một quy trình làm việc có hướng dẫn dành cho những người đóng góp không chuyên về kỹ thuật (nhà thiết kế, quản lý sản phẩm) để mô tả ý tưởng tính năng và tạo ra một kế hoạch triển khai kỹ thuật chi tiết cho một…
official
data-visualization
anthropic
Hướng dẫn chọn biểu đồ, các mẫu mã Python và nguyên tắc thiết kế để trực quan hóa dữ liệu hiệu quả. Bảng chọn biểu đồ toàn diện bao gồm hơn 13 loại biểu đồ kèm hướng dẫn về thời điểm sử dụng từng loại và các phản mẫu phổ biến cần tránh (biểu đồ tròn, 3D, trục kép). Các ví dụ mã Python sẵn sàng sử dụng cho biểu đồ đường, biểu đồ cột, biểu đồ histogram, bản đồ nhiệt, small multiples và trực quan hóa Plotly tương tác với phong cách chuyên nghiệp. Nguyên tắc thiết kế bao gồm lý thuyết màu sắc (tuần tự, phân kỳ,...
official
upstash-redis-start
upstash
Provision a zero-config, no-signup Upstash Redis database for an AI agent via a single POST to `https://upstash.com/start-redis`. Use when an agent needs…
official
microsoft-foundry
Azure
Sử dụng kỹ năng này để làm việc với Microsoft Foundry (Azure AI Foundry): triển khai các mô hình AI, quản lý agent được lưu trữ và prompt agent, quản lý quyền RBAC và phân công vai trò, quản lý hạn mức và dung lượng, tạo tài nguyên Foundry.
flutter-localization
flutter
Cấu hình ứng dụng Flutter để hỗ trợ nhiều ngôn ngữ và ngữ cảnh địa phương với thiết lập i18n phù hợp. Quản lý việc tiêm phụ thuộc (flutter_localizations, intl), cấu hình sinh mã (l10n.yaml), và tạo tệp dịch .arb với hỗ trợ cho placeholder, số nhiều, và biến thể khu vực. Cấu hình delegate widget gốc (MaterialApp, CupertinoApp, hoặc WidgetsApp) và xử lý các widget độc lập như TextField và CupertinoTabBar yêu cầu bọc Localizations rõ ràng. Hỗ trợ...
official