From 7c9903e0579f6dfd54b6de93496e39b3b6c3ea7f Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Thu, 23 Feb 2023 12:32:02 +0800
Subject: [PATCH] 日志管理使用索引提升查询性能

---
 sql/ry_20230223.sql |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/sql/ry_20230221.sql b/sql/ry_20230223.sql
similarity index 99%
rename from sql/ry_20230221.sql
rename to sql/ry_20230223.sql
index ed1aa93..0006989 100644
--- a/sql/ry_20230221.sql
+++ b/sql/ry_20230223.sql
@@ -433,7 +433,10 @@
   error_msg         varchar(2000)   default ''                 comment '错误消息',
   oper_time         datetime                                   comment '操作时间',
   cost_time         bigint(20)      default 0                  comment '消耗时间',
-  primary key (oper_id)
+  primary key (oper_id),
+  key idx_sys_oper_log_bt (business_type),
+  key idx_sys_oper_log_s  (status),
+  key idx_sys_oper_log_ot (oper_time)
 ) engine=innodb auto_increment=100 comment = '操作日志记录';
 
 
@@ -558,7 +561,9 @@
   status         char(1)        default '0'               comment '登录状态(0成功 1失败)',
   msg            varchar(255)   default ''                comment '提示信息',
   access_time    datetime                                 comment '访问时间',
-  primary key (info_id)
+  primary key (info_id),
+  key idx_sys_logininfor_s  (status),
+  key idx_sys_logininfor_lt (access_time)
 ) engine=innodb auto_increment=100 comment = '系统访问记录';
 
 

--
Gitblit v1.9.3