优化财务仪表盘查询性能

This commit is contained in:
yml2213
2026-09-04 21:37:47 +08:00
parent 7a8773d25d
commit ba5aa48c8f
11 changed files with 1748 additions and 242 deletions
@@ -0,0 +1,13 @@
-- +goose Up
-- 财务仪表盘的待线下出款金额不受日期限制,需要持续读取全部待出款订单。
-- 覆盖查询条件与汇总金额,避免通过低区分度状态索引回表扫描。
ALTER TABLE rental_orders
ADD KEY idx_rental_orders_offline_pending_amount (
settlement_mode,
offline_settlement_status,
offline_settlement_amount_cent
);
-- +goose Down
ALTER TABLE rental_orders
DROP KEY idx_rental_orders_offline_pending_amount;