热门搜索: 物流跟踪 自定义URL oauth2.0 银联
本站推荐
详细内容

ShopEx数据库索引优化,提高数据库性能,有效降低数据库CPU占用率!

时间:2012-04-26 15:41 来源:未知 作者:admin 点击:

ShopEx数据库索引优化,提高数据库性能,有效降低数据库CPU占用率!

如果您的网店商品数据量较大,比如几千上万或是更多,发现服务器的MySql占用率居高不下,商品相关页面打开比较缓慢等等,都可值得一试。

ShopEx数据库表优化记录:

通过分析数据库的慢查询日志,找出没有使用索引的以及查询速度慢的SQL语句,来逐个分析:

1

       select plugin_id,plugin_ident,plugin_name,plugin_type,plugin_base,plugin_version,plugin_author,plugin_package,plugin_website,plugin_hasopts,plugin_path,status,disabled,plugin_mtime,plugin_structfrom jiedb_plugins where plugin_type="app";

 

              select* from jiedb_plugins where plugin_type="app" and plugin_ident="openid_taobao"LIMIT 0, 1;

 

2

select title,path from jiedb_sitemaps whereaction='page:index';


3

select template_name fromjiedb_template_relation where source_id="index" and  template_type ="page" LIMIT 0, 1;

select B.template_name from jiedb_sitemapsas A LEFT JOIN jiedb_template_relation as B ON A.node_id = B.source_id where A.action ="PAGE:index " ANDB.template_type ="page" LIMIT 0, 1;

 

4

SELECT goods_id FROM jiedb_goods_keywordsWHERE  keyword in ( "BZ" );

 

5

select * from jiedb_seo WHERE 1 and  type="brand" and  source_id="19" and(store_key="keywords" or store_key ="descript" or store_key="title");

 

6

select cat_id,count(*) as nums fromjiedb_goods where  brand_id=19  group by cat_id;

 

7

SELECT bn,name,cat_id,price,store,marketable,brand_id,weight,d_order,uptime,type_id,supplier_id,goods_id,image_default,thumbnail_pic,brief,pdt_desc,mktprice,big_pic,big_picFROM jiedb_goods WHERE cat_id IN (6) AND jiedb_goods.disabled = 'false' ANDjiedb_goods.marketable='true' AND jiedb_goods.goods_type='normal' ORDER BYlast_modify desc LIMIT 36, 36;

SELECT COUNT(brand_id) as brand_cat,brand_idFrom jiedb_goods where cat_id in(9) AND marketable="true" ANDdisabled="false" GROUP By brand_id;

select count(*) as c from jiedb_goods WHEREcat_id IN (9) AND jiedb_goods.disabled = 'false' ANDjiedb_goods.marketable='true' AND jiedb_goods.goods_type='normal' ORDER BYd_order  DESC ,p_order  DESC;

SELECTbn,name,cat_id,price,store,marketable,brand_id,weight,d_order,uptime,type_id,supplier_id,goods_id,image_default,thumbnail_pic,brief,pdt_desc,mktprice,big_pic,big_picFROM jiedb_goods WHERE cat_id IN (6) AND jiedb_goods.disabled = 'false' ANDjiedb_goods.marketable='true' AND jiedb_goods.goods_type='normal' ORDER BYprice LIMIT 288, 36;

 

(8)

SELECT nums FROM jiedb_order_items WHEREproduct_id='53440' AND order_id='' LIMIT 0, 1;

9)

select count(*) as c from jiedb_sell_logsWHERE goods_id = 68864 ORDER BY log_id DESC;

 

10)

select * from jiedb_gimages wheregoods_id=68864;

需要进行优化的商家朋友,请与我们的在线客服联系咨询相关事项!


(责任编辑:admin)
标签:shopex优化数据库性能CPU索引占用率
上一篇:ShopEx二次开发之会员下完订单之后上传订单关联文件 下一篇:ShopEx二次开发之仿分销王系统会员中心订单查询界面及功能!