"Index"
- PostgreSQL Index Selection:B-tree / GIN / GiST / BRIN / Hash 對應 workload 的決策樹
PG 有 6 種 index method(B-tree / Hash / GIN / GiST / SP-GiST / BRIN)跟 partial / expression / covering 三種變體、不是「都用 B-tree 就好」。每種 index 有自己的 query pattern、儲存代價、write amplification 跟 maintenance 成本。本文走 6 種 index 的適用 workload 對照、決策樹、partial / expression / covering / multi-column 變體、5 production 踩雷(過度 index / partial 條件不對 / B-tree 對 JSON 無效 / BRIN 對非 correlated 資料無效 / multi-column 順序錯)、跟 query-optimization 的 EXPLAIN 互補
- SQLite SQL Dialect and Index Limits
SQLite type affinity、NULL / date handling、constraint、index、query planner 與 PostgreSQL / MySQL 差異