-- 每日排行榜按验收时间筛选，避免全表扫描已完成工单与拼单记录。
CREATE INDEX IF NOT EXISTS idx_work_orders_accepted_at_worker
  ON work_orders(accepted_at DESC, assigned_worker_id)
  WHERE status = 'accepted' AND assigned_worker_id IS NOT NULL;

CREATE INDEX IF NOT EXISTS idx_work_order_shares_accepted_at_worker
  ON work_order_shares(accepted_at DESC, worker_id)
  WHERE status = 'accepted';
