全项目数据库性能优化

This commit is contained in:
yml2213
2026-08-20 23:04:52 +08:00
parent 1c8eda2b5f
commit b5d46b2381
13 changed files with 168 additions and 43 deletions
@@ -0,0 +1,13 @@
-- 高频打手订单、拼单统计、快手回调扫描和仪表盘查询的索引保护。
CREATE INDEX IF NOT EXISTS idx_work_order_shares_order_status_include_quantity
ON work_order_shares(work_order_id, status) INCLUDE (quantity);
CREATE INDEX IF NOT EXISTS idx_work_order_events_order_type
ON work_order_events(work_order_id, event_type);
CREATE INDEX IF NOT EXISTS idx_fulfillment_tasks_status_updated_at
ON fulfillment_tasks(task_status, updated_at DESC);
CREATE INDEX IF NOT EXISTS idx_kuaishou_industry_vouchers_callback_retry_order
ON kuaishou_industry_vouchers(COALESCE(send_callback_sent_at, created_at), id)
WHERE send_callback_status <> 'success';