06/08 Optimize queries with indexes
This commit is contained in:
@@ -559,7 +559,18 @@ phase1_projects_roles → phase6_features → phase7_mobile_api → phase8_notif
|
||||
→ phase17_notification_event_type
|
||||
→ phase18_issue_reported_by
|
||||
→ phase19_issue_mobile_photos
|
||||
→ phase20_inspector_assignments ← HEAD
|
||||
→ phase20_inspector_assignments
|
||||
→ phase21_performance_indexes ← HEAD
|
||||
```
|
||||
|
||||
### phase21_performance_indexes
|
||||
|
||||
Adds four composite indexes covering the highest-traffic multi-column query patterns: `(facility_id, inspection_date)` and `(inspector_id, inspection_date)` and `(status, inspection_date)` on `inspections`; `(facility_id, status)` on `issues`. All single-column indexes already exist from phase12. Uses `INFORMATION_SCHEMA.STATISTICS` existence check — safe to re-run.
|
||||
|
||||
**Deploy order for phase21:**
|
||||
```bash
|
||||
flask db upgrade
|
||||
sudo systemctl restart gunicorn
|
||||
```
|
||||
|
||||
### phase19_issue_mobile_photos
|
||||
|
||||
Reference in New Issue
Block a user