@S2JH 你好,想跟你请教个问题:造了一百个用户,点击用户管理,等待十几秒钟数据才显示出来,翻页也要等待十几秒,底层访问这块看了要优化一下。
所以说着程序要优化一下
所以说这程序要优化一下。
楼主这是MYSQL吧??MYSQL查询某一个对象时,不要大量joining。。最好分开几部分查。。
11:54:29.570 DEBUG jdbc.sqlonly[232] - sun.reflect.GeneratedMethodAccessor64.invoke(null:-1)26. select count(*) as col_0_0_ from tbl_auth_department department0_ left outer join t_auth_user user1_ on department0_.user_id=user1_.sid 11:54:33.314 DEBUG jdbc.sqlonly[232] - sun.reflect.GeneratedMethodAccessor64.invoke(null:-1)26. select department0_.id as id2_0_, user1_.sid as sid8_1_, department0_.acl_code as acl2_2_0_, department0_.acl_type as acl3_2_0_, department0_.created_by as created4_2_0_, department0_.created_dt as created5_2_0_, department0_.updated_by as updated6_2_0_, department0_.updated_dt as updated7_2_0_, department0_.version as version2_0_, department0_.code as code2_0_, department0_.contact_tel as contact10_2_0_, department0_.description as descrip11_2_0_, department0_.user_id as user13_2_0_, department0_.title as title2_0_, user1_.acl_code as acl2_8_1_, user1_.acl_type as acl3_8_1_, user1_.created_by as created4_8_1_, user1_.created_dt as created5_8_1_, user1_.updated_by as updated6_8_1_, user1_.updated_dt as updated7_8_1_, user1_.version as version8_1_, user1_.account_expire_time as account9_8_1_, user1_.account_non_locked as account10_8_1_, user1_.credentials_expire_time as credent11_8_1_, user1_.department_id as department27_8_1_, user1_.email as email8_1_, user1_.enabled as enabled8_1_, user1_.last_logon_failure_time as last14_8_1_, user1_.last_logon_host as last15_8_1_, user1_.last_logonip as last16_8_1_, user1_.last_logon_time as last17_8_1_, user1_.logon_failure_times as logon18_8_1_, user1_.logon_times as logon19_8_1_, user1_.nick as nick8_1_, user1_.password as password8_1_, user1_.random_code as random22_8_1_, user1_.user_id as user23_8_1_, user1_.signup_time as signup24_8_1_, user1_.uid as uid8_1_, user1_.user_pin as user26_8_1_ from tbl_auth_department department0_ left outer join t_auth_user user1_ on department0_.user_id=user1_.sid order by department0_.created_dt desc limit 15
mysql数据库啊,造了一百万条部门数据。
什么数据库?我尝试分析看看执行计划
不至于吧???要不把SQL语句粘贴出来看看
100万数据要十几秒,绝对有问题啊,
程序没改过直接运行的,然后造了一百万条数据。
原程序运行的,你可以下载下来看看
翻页一次查了多少条数据?sql是按什么字段排序,该字段是否有索引?
原程序没改过,你可以下载下来看看
是不是没有通过主键或者索引查询,一百万数据真不算多
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(13)
所以说着程序要优化一下
所以说这程序要优化一下。
楼主这是MYSQL吧??MYSQL查询某一个对象时,不要大量joining。。最好分开几部分查。。
11:54:29.570 DEBUG jdbc.sqlonly[232] - sun.reflect.GeneratedMethodAccessor64.invoke(null:-1)
26. select count(*) as col_0_0_ from tbl_auth_department department0_ left outer join t_auth_user
user1_ on department0_.user_id=user1_.sid
11:54:33.314 DEBUG jdbc.sqlonly[232] - sun.reflect.GeneratedMethodAccessor64.invoke(null:-1)
26. select department0_.id as id2_0_, user1_.sid as sid8_1_, department0_.acl_code as acl2_2_0_,
department0_.acl_type as acl3_2_0_, department0_.created_by as created4_2_0_, department0_.created_dt
as created5_2_0_, department0_.updated_by as updated6_2_0_, department0_.updated_dt as updated7_2_0_,
department0_.version as version2_0_, department0_.code as code2_0_, department0_.contact_tel
as contact10_2_0_, department0_.description as descrip11_2_0_, department0_.user_id as user13_2_0_,
department0_.title as title2_0_, user1_.acl_code as acl2_8_1_, user1_.acl_type as acl3_8_1_,
user1_.created_by as created4_8_1_, user1_.created_dt as created5_8_1_, user1_.updated_by as
updated6_8_1_, user1_.updated_dt as updated7_8_1_, user1_.version as version8_1_, user1_.account_expire_time
as account9_8_1_, user1_.account_non_locked as account10_8_1_, user1_.credentials_expire_time
as credent11_8_1_, user1_.department_id as department27_8_1_, user1_.email as email8_1_, user1_.enabled
as enabled8_1_, user1_.last_logon_failure_time as last14_8_1_, user1_.last_logon_host as last15_8_1_,
user1_.last_logonip as last16_8_1_, user1_.last_logon_time as last17_8_1_, user1_.logon_failure_times
as logon18_8_1_, user1_.logon_times as logon19_8_1_, user1_.nick as nick8_1_, user1_.password
as password8_1_, user1_.random_code as random22_8_1_, user1_.user_id as user23_8_1_, user1_.signup_time
as signup24_8_1_, user1_.uid as uid8_1_, user1_.user_pin as user26_8_1_ from tbl_auth_department
department0_ left outer join t_auth_user user1_ on department0_.user_id=user1_.sid order by
department0_.created_dt desc limit 15
mysql数据库啊,造了一百万条部门数据。
什么数据库?我尝试分析看看执行计划
不至于吧???要不把SQL语句粘贴出来看看
100万数据要十几秒,绝对有问题啊,
程序没改过直接运行的,然后造了一百万条数据。
原程序运行的,你可以下载下来看看
翻页一次查了多少条数据?sql是按什么字段排序,该字段是否有索引?
原程序没改过,你可以下载下来看看
是不是没有通过主键或者索引查询,一百万数据真不算多