mysql索引缓存的内容_mysql 性能优化索引、缓存、分表、分布式实现方式。

本篇文章主要介绍了" mysql 性能优化索引、缓存、分表、分布式实现方式。",主要涉及到方面的内容,对于MySql感兴趣的同学可以参考一下: 系统针对5000台终端测试结果索引目标:优化查询速度3秒以内 需要优化。尽量避免使用select * 来查询对象。使用到哪些属性就查询出哪些使用即可首页页面:设...

系统针对5000台终端测试结果

索引

目标:优化查询速度3秒以内 需要优化。尽量避免使用select * 来查询对象。使用到哪些属性值就查询出哪些使用即可

首页页面:

设备-组织查询 优化 避免使用select * 来查询device对象 优化前耗时 200毫秒 优化后耗时19毫秒

设备-在线 优化 避免使用select * 来查询device对象 优化前耗时 210毫秒 优化后耗时11毫秒

设备-版本 优化 避免使用select * 来查询device对象 优化前耗时 230毫秒 优化后耗时10毫秒

终端检查报告页面:

查看报告详细报告 优化前耗时3603毫秒 优化后耗1103毫秒

优化方式:

1:ccp_infraction 建立联合索引 checkItemId和reportId

create index ccp_infraction_index on  ccp_infraction (reportId,checkItemId) ;

查看报告所有结果和人工判定 优化前耗时10300毫秒 优化后耗时1973毫秒

优化方式:添加联系索引

create index idx_1 on ccp_artificial (reportId,isInfraction);

create index idx_2 on ccp_terminalinfo(reportId);

create index idx_3 on ccp_currenttimerep(reportId);

create index idx_4 on ccp_hostrep (reportId);

create index idx_5 on ccp_currentaccountrep(reportId);

create index idx_6 on ccp_accountrep(reportId,isInfraction);

create index idx_7 on ccp_hardwarerep(reportId,isInfraction);

create index idx_8 on ccp_networkrep (reportId);

create index idx_9 on ccp_softwarerep(reportId,isInfraction);

create index idx_10 on ccp_diskrep (reportId,isInfraction);

create index idx_11 on ccp_partitioninforep(reportId);

create index idx_12 on ccp_oneKeyInforep(reportId,isInfraction);

create index idx_13 on ccp_usbinforep(reportId,isInfraction);

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值