supabase-postgres-best-practices
運用 Supabase 實務最佳化 Postgres
Postgres 效能問題通常來自缺少索引、薄弱的 RLS 政策,以及不良的連線管理。此技能提供與 Supabase 實務一致的規則,用於改善查詢、結構描述設計與資料庫作業。
使用我的智慧代理安裝
將此請求複製給你的智慧代理,其中包含權威 Skill 頁面和清單。
Review the Skillstore skill "supabase-postgres-best-practices" from https://skillstore.io/skills/sickn33-supabase-postgres-best-practices.md and its manifest at https://skillstore.io/api/skills/sickn33-supabase-postgres-best-practices/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智慧代理仍應顯示其計畫,並依安全政策請求必要確認。
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「supabase-postgres-best-practices」。 查詢依客戶和狀態篩選訂單,然後依建立日期排序。
預期結果:
此技能建議使用複合索引,從等值篩選開始,並以範圍或排序欄位結尾。它也建議使用 EXPLAIN ANALYZE 檢查計畫。
正在使用「supabase-postgres-best-practices」。 Supabase 應用程式使用直接呼叫驗證輔助程式的 RLS 政策。
預期結果:
此技能說明重複函式呼叫為何會拖慢大型掃描,並建議快取的政策運算式,以及針對政策欄位建立索引。
正在使用「supabase-postgres-best-practices」。 資料表儲存數億筆帶時間戳記的事件。
預期結果:
此技能建議依時間進行範圍分割、使用較小的本機索引,並在驗證後透過刪除分割區實作保留策略。
安全審計
安全AI adjudication found the static alerts are documentation examples, Markdown formatting, or reference URLs rather than executable behavior. No evidence found for malicious prompt injection, secret access, unauthorized command execution, or data exfiltration intent.
風險因素
⚡ 包含腳本 (4)
🌐 網路存取 (6)
分享與引用此報告
分享版本化評估報告、中性徽章、嵌入卡片與引用。Skillstore 只報告證據,不判斷該 Skill 是否安全。
複製報告連結
https://skillstore.io/skills/sickn33-supabase-postgres-best-practices/audits/4?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/sickn33-supabase-postgres-best-practices?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/sickn33-supabase-postgres-best-practices?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/sickn33-supabase-postgres-best-practices/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/sickn33-supabase-postgres-best-practices.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>學術引用 (APA · BibTeX · CFF)
APA 引用
sickn33. (2026). supabase-postgres-best-practices security audit report (audit version 4) [Author version 1.0.0]. Skillstore. https://skillstore.io/skills/sickn33-supabase-postgres-best-practices/audits/4BibTeX 引用
@techreport{sickn33-sickn33-supabase-postgres-best-practices-2026,
author = {sickn33},
title = {supabase-postgres-best-practices security audit report (audit version 4)},
institution = {Skillstore},
year = {2026},
number = {4},
url = {https://skillstore.io/skills/sickn33-supabase-postgres-best-practices/audits/4},
note = {Author version 1.0.0}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "supabase-postgres-best-practices security audit report (audit version 4)"
version: "1.0.0"
type: report
authors:
- name: "sickn33"
date-released: "2026-07-07"
url: "https://skillstore.io/skills/sickn33-supabase-postgres-best-practices/audits/4"
identifiers:
- type: other
value: "skillstore:sickn33-supabase-postgres-best-practices:audit:4"
description: "Skillstore immutable audit report identifier"
比較變體
2 個可安裝變體每位作者的技能都保留為獨立的可安裝項目。推薦變體依 Skillstore 證據排序。
為何此變體排名第一
Skillstore 評分
評分依據 證據置信度: 高你可以打造什麼
審查緩慢查詢
在變更生產環境 SQL 之前,識別可能缺少的索引、不良分頁和低效率聯結。
設計多租戶結構描述
為 Supabase 應用程式套用 RLS、外鍵索引和最小權限模式。
準備資料庫擴展工作
在流量成長或資料遷移之前,規劃連線池、分割區和診斷檢查。
試試這些提示
審查這個 Postgres 查詢是否缺少索引、存在不良篩選,以及是否需要更安全的分頁。依優先順序說明最重要的改善項目。
審查這個資料表設計的資料型別、主鍵、外鍵索引和分割區機會。為每項建議納入取捨說明。
分析這些 Supabase RLS 政策的安全性和效能。尋找逐列函式呼叫、缺少的索引,以及最小權限落差。
為這個工作負載建立優先排序的 Postgres 稽核計畫。涵蓋查詢計畫、連線池、交易、維護和監控檢查。
最佳實務
- 發布前,使用代表性資料透過 EXPLAIN ANALYZE 驗證每項建議。
- 當外鍵和政策欄位出現在頻繁聯結或 RLS 述詞中時,為它們建立索引。
- 保持交易簡短,並使用符合部署模型的連線池設定。
避免
- 在未符合實際查詢模式的情況下新增大量單欄索引。
- 在大型已排序資料表的深層頁面使用 OFFSET 分頁。
- 依賴應用程式篩選,而不是由資料庫強制執行租戶隔離。
常見問題
此技能會對我的資料庫執行 SQL 嗎?
它是 Supabase 專用的嗎?
它可以自動選擇索引嗎?
它涵蓋 Row Level Security 嗎?
我可以將它與 Claude、Codex 和 Claude Code 一起使用嗎?
我應該提供什麼以獲得最佳結果?
開發者詳細資訊
作者
sickn33授權
MIT
作者版本
v1.0.0
Skillstore 修訂
r1
引用
9f814fc6a43fd99946f2da5e0df231c65a38bc76
維護新鮮度
2026/7/18
使用量
7 次下載 · 157 次瀏覽