优化财务仪表盘查询性能
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user