Files
hfb_sys/backend/migrations/000090_invitation_rebate_invitee_index.sql
T

10 lines
400 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- +goose Up
-- 后台返利流水按完整被邀请人手机号搜索时,先经 users(phone) 解析 ID,
-- 再由该索引定位流水,避免回退为用户表与流水表的跨表全扫描。
ALTER TABLE invitation_rebate_ledgers
ADD KEY idx_invitation_rebate_invitee (invitee_id, settled_at);
-- +goose Down
ALTER TABLE invitation_rebate_ledgers
DROP KEY idx_invitation_rebate_invitee;