Install any skill in seconds. Free to start, no credit card required.
Get Started Free →loulanyue/postgres-patterns
PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
1 fixed21 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
我正在建立電子商務系統的訂單資料表,包含主鍵識別碼、客戶識別碼、訂單狀態、建立時間、總金額(需防止精確度誤差),以及 JSON 擴充欄位。請幫我編寫 PostgreSQL 的 DDL,並為「特定狀態加時間範圍」查詢情境設計最合適的索引定義。
| Checked | Without skill | With skill |
|---|---|---|
| Uses text data type for the order status string column instead of varchar | Missed | Passed |
| Uses numeric data type for the total amount column to prevent precision loss | Passed | Passed |
| Orders composite index columns with equality column before range column | Passed | Passed |
The instructions your model reads when the skill loads.
PostgreSQL 最佳實務快速參考。詳細指南請使用 database-reviewer agent。
| 查詢模式 | 索引類型 | 範例 |
|---|---|---|
WHERE col = value | B-tree(預設) | CREATE INDEX idx ON t (col) |
WHERE col > value | B-tree | CREATE INDEX idx ON t (col) |
WHERE a = x AND b > y | 複合 | CREATE INDEX idx ON t (a, b) |
WHERE jsonb @> '{}' | GIN | CREATE INDEX idx ON t USING gin (col) |
WHERE tsv @@ query | GIN | CREATE INDEX idx ON t USING gin (col) |
| 時間序列範圍 | BRIN | CREATE INDEX idx ON t USING brin (col) |
| 使用情況 | 正確類型 | 避免 |
|---|---|---|
| IDs | bigint | int、隨機 UUID |
| 字串 | text | varchar(255) |
| 時間戳 | timestamptz | timestamp |
| 金額 | numeric(10,2) | float |
| 旗標 | boolean | varchar、int |
複合索引順序:
-- 等值欄位優先,然後是範圍欄位
test cases passed, vs 21 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.