feat: add index on user.refer_code for faster invite code lookup

- Add idx_refer_code index to improve query performance
- Prevents full table scan when validating invite codes during registration
This commit is contained in:
EUForest 2026-01-10 20:37:24 +08:00
parent 3359704a45
commit 2a1ae2e1cc
2 changed files with 4 additions and 0 deletions

View File

@ -0,0 +1,2 @@
-- Remove index on refer_code column
ALTER TABLE `user` DROP INDEX `idx_refer_code`;

View File

@ -0,0 +1,2 @@
-- Add index on refer_code column for faster lookup
ALTER TABLE `user` ADD INDEX `idx_refer_code` (`refer_code`);