feat: 添加数据库索引优化查询性能

refactor(前端): 使用useMemo和useCallback优化性能
perf(后端): 优化统计查询性能
style: 统一前端样式定义
build: 添加创建索引脚本
This commit is contained in:
zhang1106
2026-01-20 14:31:20 +08:00
parent 88e000a41a
commit a2f0032bad
25 changed files with 803 additions and 701 deletions
+9 -1
View File
@@ -72,7 +72,15 @@ const Device = sequelize.define('Device', {
}
}, {
tableName: 'devices',
timestamps: true
timestamps: true,
indexes: [
{ fields: ['status'] },
{ fields: ['type'] },
{ fields: ['rackId'] },
{ fields: ['createdAt'] },
{ fields: ['status', 'type'] },
{ fields: ['name'] }
]
});
// 关联关系