原创

DESTOON MYSQL占用大量CPU的优化

     订阅 destoon二开     2020-04-28 12:30     www.dtmuban.com     小黑     723     0     0     0
destoon程序前端开发教程
学习要点:以下是SQL语句(请对照自己的SQL表前缀,教程以默认前缀为例),执行前请先备份SQL

DESTOON  MYSQL占用大量CPU的优化

以下是SQL语句(请对照自己的SQL表前缀,教程以默认前缀为例),执行前请先备份SQL

ALTER TABLE `destoon_sell_5` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_sell_5` ADD INDEX ( `vip` ) ;
ALTER TABLE `destoon_sell_5` ADD INDEX ( `thumb` ) ;
ALTER TABLE `destoon_sell_5` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_sell_5` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_mall_16` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_mall_16` ADD INDEX ( `vip` ) ;
ALTER TABLE `destoon_mall_16` ADD INDEX ( `thumb` ) ;
ALTER TABLE `destoon_mall_16` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_mall_16` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_buy_6` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_buy_6` ADD INDEX ( `vip` ) ;
ALTER TABLE `destoon_buy_6` ADD INDEX ( `thumb` ) ;
ALTER TABLE `destoon_buy_6` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_buy_6` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_quote_7` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_quote_7` ADD INDEX ( `thumb` ) ; 
ALTER TABLE `destoon_quote_7` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_group_17` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_group_17` ADD INDEX ( `vip` ) ;
ALTER TABLE `destoon_group_17` ADD INDEX ( `thumb` ) ;
ALTER TABLE `destoon_group_17` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_group_17` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_exhibit_8` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_exhibit_8` ADD INDEX ( `thumb` ) ;
ALTER TABLE `destoon_exhibit_8` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_news` ADD INDEX ( `status` ) ;

ALTER TABLE `destoon_info_22` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_info_22` ADD INDEX ( `vip` ) ;
ALTER TABLE `destoon_info_22` ADD INDEX ( `thumb` ) ;
ALTER TABLE `destoon_info_22` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_info_22` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_brand_13` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_brand_13` ADD INDEX ( `vip` ) ;
ALTER TABLE `destoon_brand_13` ADD INDEX ( `thumb` ) ;
ALTER TABLE `destoon_brand_13` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_brand_13` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_job_9` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_job_9` ADD INDEX ( `vip` ) ;
ALTER TABLE `destoon_job_9` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_job_9` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_know_10` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_know_10` ADD INDEX ( `thumb` ) ;
ALTER TABLE `destoon_know_10` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_photo_12` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_photo_12` ADD INDEX ( `thumb` ) ;
ALTER TABLE `destoon_photo_12` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_video_14` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_video_14` ADD INDEX ( `thumb` ) ;
ALTER TABLE `destoon_video_14` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_down_15` ADD INDEX ( `status` ) ; 
ALTER TABLE `destoon_down_15` ADD INDEX ( `thumb` ) ;
ALTER TABLE `destoon_down_15` ADD INDEX ( `ip` ) ;

ALTER TABLE `destoon_404` ADD INDEX ( `url` ) ;
ALTER TABLE `destoon_404` ADD INDEX ( `addtime` ) ;

ALTER TABLE `destoon_company` ADD INDEX ( `catid` ) ;
ALTER TABLE `destoon_company` ADD INDEX (`catids`);  
ALTER TABLE `destoon_company` ADD FULLTEXT (`catids`);

ALTER TABLE `destoon_upload_0` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_upload_0` ADD INDEX ( `username` ) ;
ALTER TABLE `destoon_upload_1` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_upload_1` ADD INDEX ( `username` ) ;
ALTER TABLE `destoon_upload_2` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_upload_2` ADD INDEX ( `username` ) ;
ALTER TABLE `destoon_upload_3` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_upload_3` ADD INDEX ( `username` ) ;
ALTER TABLE `destoon_upload_4` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_upload_4` ADD INDEX ( `username` ) ;
ALTER TABLE `destoon_upload_5` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_upload_5` ADD INDEX ( `username` ) ;
ALTER TABLE `destoon_upload_6` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_upload_6` ADD INDEX ( `username` ) ;
ALTER TABLE `destoon_upload_7` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_upload_7` ADD INDEX ( `username` ) ;
ALTER TABLE `destoon_upload_9` ADD INDEX ( `addtime` ) ;
ALTER TABLE `destoon_upload_9` ADD INDEX ( `username` ) ;
 
ALTER TABLE `destoon_category` ADD INDEX (`parentid`) ;
ALTER TABLE `destoon_category` ADD INDEX (`listorder`)
ALTER TABLE `destoon_category` ADD INDEX (`item`) ;
 
ALTER TABLE `destoon_area` ADD INDEX (`parentid`) ;
ALTER TABLE `destoon_area` ADD INDEX (`listorder`) ;
 
ALTER TABLE `destoon_comment_stat` ADD INDEX (`moduleid`) ;
ALTER TABLE `destoon_comment_stat` ADD INDEX (`itemid`) ;
 
ALTER TABLE `destoon_message` ADD INDEX (`ip`) ;
ALTER TABLE `destoon_message` ADD INDEX (`typeid`) ;
ALTER TABLE `destoon_message` ADD INDEX (`status`) ;
ALTER TABLE `destoon_message` ADD INDEX (`addtime`);
ALTER TABLE `destoon_message` ADD INDEX (`isread`) ;
ALTER TABLE `destoon_message` ADD INDEX (`issend`);

ALTER TABLE `destoon_online` ADD INDEX ( `lasttime` ) ;
 
ALTER TABLE `destoon_guestbook` ADD INDEX ( `status` ) ;
 
ALTER TABLE `destoon_keyword` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_keyword` ADD INDEX ( `updatetime` ) ;
ALTER TABLE `destoon_keyword` ADD INDEX ( `month_search` ) ;
ALTER TABLE `destoon_keyword` ADD INDEX ( `total_search` ) ;
ALTER TABLE `destoon_keyword` ADD INDEX ( `week_search` ) ;
ALTER TABLE `destoon_keyword` ADD INDEX ( `today_search` ) ;
 
ALTER TABLE `destoon_alert` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_alert` ADD INDEX ( `addtime` ) ;
 
ALTER TABLE `destoon_webpage` ADD INDEX ( `item` ) ;
ALTER TABLE `destoon_webpage` ADD INDEX ( `listorder` ) ;
 
ALTER TABLE `destoon_announce` ADD INDEX ( `listorder` ) ;
 
ALTER TABLE `destoon_link` ADD INDEX ( `status` ) ;
 
ALTER TABLE `destoon_member` ADD INDEX ( `regtime` ) ;
 
ALTER TABLE `destoon_ad` ADD INDEX ( `status` ) ;
ALTER TABLE `destoon_ad` ADD INDEX ( `username` ) ;

ALTER TABLE `destoon_spread` ADD INDEX ( `username` ) ;
ALTER TABLE `destoon_spread` ADD INDEX ( `status` ) ;

#下面为全文索引 destoon_club_data_18 类似的模块内容全文最好都开启 其它的后台有提示

ALTER TABLE `destoon_club_data_18` ADD FULLTEXT (`content`);
ALTER TABLE  `destoon_cron` ADD INDEX (`nexttime`);
ALTER TABLE  `destoon_online` ADD INDEX (`username`);

#公司 供应 模块增加全文索引 建议用ngram版

ALTER TABLE `destoon_company` ADD FULLTEXT (`company`);
ALTER TABLE `destoon_company` ADD FULLTEXT (`business`);
ALTER TABLE `destoon_company_data` ADD FULLTEXT (`content`); 

ALTER TABLE `destoon_sell_5` ADD FULLTEXT (`title`);
ALTER TABLE `destoon_sell_data_5` ADD FULLTEXT (`content`);

#用中文检索分词插件ngram版 MySQL 5.7.6以上版本 中文识别友好 要修改程序

ALTER TABLE `destoon_keyword` ADD FULLTEXT (`keyword`) WITH PARSER ngram;

ALTER TABLE `destoon_company` ADD FULLTEXT (`company`,`business`) WITH PARSER ngram;

ALTER TABLE `destoon_sell_5` ADD FULLTEXT (`title`,`introduce`)WITH PARSER ngram;

微信扫码查看本文(微信小程序)

--结束END--

有问题投稿请发送至: 邮箱/kf@dtmuban.com    QQ/290948585

本文标题: DESTOON MYSQL占用大量CPU的优化

本文链接: https://www.mbkfw.com/course/740.html (转载时请注明来源链接)

阅读更多
 
本文标签: 优化 SQL 数据库

下班PC阅读不方便?

手机也可以随时学习开发

微信关注公众号“商企云服”
"模板开发网前端开发教学"
每日干货技术分享
【ECS精选特惠】新用户上云低至1折起
 
0

圈友点评

文明上网理性发言,请遵守网络评论服务协议

×

《客户实名在线注册登记》售后一直都在!

关注

微信
关注

幸运大转盘,好礼等您拿

模板开发网公众号

模板开发网微信小程序

代授权

程序
授权

小黑

联系
客服

联系客服:

在线QQ: 290948585

客服电话: 18605917465

E_mail邮箱: kf@dtmuban.com

微信公众号: 商企云服

微信小程序: dt模板

售前咨询 售后服务 DT授权代办 在线交谈 智能小云

工作时间:

周一至周五: 09:00 - 18:00

反馈

用户
反馈