[REFACTOR] 優化資料庫查詢效能:在多個 Service 與 Controller 中加入 select 欄位限制,並新增租戶資料表索引 Migration。

This commit is contained in:
2026-03-09 14:59:37 +08:00
parent 89291918fd
commit a987f4345e
13 changed files with 143 additions and 24 deletions

View File

@@ -20,6 +20,7 @@ Skills 位於 `.agents/skills/`,採漸進式揭露以節省 Token。
| 按鈕樣式、表格規範、圖標、分頁、Badge、Toast、表單、UI 統一、頁面佈局、`button-filled-*``button-outlined-*``lucide-react`、色彩系統 | **客戶端後台 UI 統一規範** | `.agents/skills/ui-consistency/SKILL.md` |
| Git 分支、commit、push、合併、部署、`feature/``hotfix/``develop``main` | **Git 分支管理與開發規範** | `.agents/skills/git-workflows/SKILL.md` |
| E2E、端到端測試、Playwright、`spec.ts`、功能驗證、自動化測試、回歸測試 | **E2E 端到端測試規範** | `.agents/skills/e2e-testing/SKILL.md` |
| 查詢、撈資料、Query、Controller、下拉選單、Eloquent、N+1、`->get()`、select | **Eloquent 與 MySQL 查詢優化規範** | `/home/mama/.gemini/antigravity/global_skills/eloquent-optimization/SKILL.md` |
---
@@ -43,6 +44,10 @@ Skills 位於 `.agents/skills/`,採漸進式揭露以節省 Token。
必須讀取:
1. **git-workflows** — 分支命名與 commit 格式
### 🔴 新增或修改 API 與 Controller 撈取資料庫邏輯時
必須讀取:
1. **eloquent-optimization** — 確認查詢是否有做適當的 `select` 優化與 N+1 檢查
---
## 注意事項