3.8K Star 15.5K Fork 5.1K

卓源软件 / JeeSite 4.5 and 5.0

 / 详情

查询登陆日志用时长的问题

待办的
创建于  
2022-09-20 16:05

是什么问题、该问题是怎么引起的?

两万多条数据分页查询就用了接近20秒,页数越大越慢。

重现步骤、期望结果、截图、代码

输入图片说明
1.

SELECT TOP
	20 "corpCode",
	"corpName",
	"id",
	"logType",
	"logTitle",
	"createBy",
	"createByName",
	"createDate",
	"requestUri",
	"requestMethod",
	"requestParams",
	"diffModifyData",
	"bizKey",
	"bizType",
	"remoteAddr",
	"serverAddr",
	"isException",
	"exceptionInfo",
	"userAgent",
	"deviceName",
	"browserName",
	"executeTime" 
FROM
	(
SELECT
	ROW_NUMBER () OVER ( ORDER BY "createDate" DESC ) PAGE_ROW_NUMBER,
	"corpCode",
	"corpName",
	"id",
	"logType",
	"logTitle",
	"createBy",
	"createByName",
	"createDate",
	"requestUri",
	"requestMethod",
	"requestParams",
	"diffModifyData",
	"bizKey",
	"bizType",
	"remoteAddr",
	"serverAddr",
	"isException",
	"exceptionInfo",
	"userAgent",
	"deviceName",
	"browserName",
	"executeTime" 
FROM
	(
SELECT
	a.corp_code AS "corpCode",
	a.corp_name AS "corpName",
	a.id AS "id",
	a.log_type AS "logType",
	a.log_title AS "logTitle",
	a.create_by AS "createBy",
	a.create_by_name AS "createByName",
	a.create_date AS "createDate",
	a.request_uri AS "requestUri",
	a.request_method AS "requestMethod",
	a.request_params AS "requestParams",
	a.diff_modify_data AS "diffModifyData",
	a.biz_key AS "bizKey",
	a.biz_type AS "bizType",
	a.remote_addr AS "remoteAddr",
	a.server_addr AS "serverAddr",
	a.is_exception AS "isException",
	a.exception_info AS "exceptionInfo",
	a.user_agent AS "userAgent",
	a.device_name AS "deviceName",
	a.browser_name AS "browserName",
	a.execute_time AS "executeTime" 
FROM
	js_sys_log a 
WHERE
	a.log_type = 'loginLogout' 
	) AS PAGE_TABLE_ALIAS 
	) AS PAGE_TABLE_ALIAS 
WHERE
	PAGE_ROW_NUMBER > 29640 
ORDER BY
	PAGE_ROW_NUMBER

实际结果、报错信息、截图

这里贴错误信息

环境版本:

  • JDK版本:1.8、11、17
  • 浏览器版本:Chrome xx、Firefox xx、IE xx
  • 平台版本:JeeSite 4.x.x、5.x.x(pom.xml里查看)

评论 (2)

chung-sl 创建了任务
chung-sl 修改了描述
展开全部操作日志

sqlserver如果是2012以上版本可以试下 yml里设置 jdbc.type: mssql2012

设置了还是不行,在navicat里面执行sql也是一样的慢。还有其他解决办法吗?

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
6732 thinkgem 1651893329
Java
1
https://gitee.com/thinkgem/jeesite4.git
git@gitee.com:thinkgem/jeesite4.git
thinkgem
jeesite4
JeeSite 4.5 and 5.0

搜索帮助