perf(database): 优化数据库配置和用户查询性能

- 更新 Redis 配置为本地 1Panel 实例
- 为 UserMapper 查询添加 LIMIT 1 限制
- 为 credit_user 表创建多个复合索引以提升查询效率
- 添加租户、公司、用户维度的索引支持
- 优化默认分页排序的索引覆盖
- 包含统计关联数的索引优化
This commit is contained in:
2026-03-19 00:00:45 +08:00
parent 6a48722b67
commit 3b723a74c6
3 changed files with 38 additions and 3 deletions

View File

@@ -259,6 +259,7 @@
LEFT JOIN gxwebsoft_core.sys_user_referee h ON a.user_id = h.user_id and h.deleted = 0
WHERE a.user_id = #{userId}
AND a.deleted = 0
LIMIT 1
</select>
</mapper>

View File

@@ -15,9 +15,9 @@ spring:
# redis
redis:
database: 0
host: 47.119.165.234
port: 16379
password: redis_WSDb88
host: 1Panel-redis-GmNr
port: 6379
password: redis_t74P8C
# 日志配置
logging: