网站w3wp.exe和mysqld-nt.exe占资源,求大侠解答

2016-07-07 15:14 来源:www.chinab4c.com 作者:ecshop专家

网站一共3800多商品,商品属性也不多,就是w3wp.exe和mysqld-nt.exe占资源,网站开启了慢查询日志,列举了几条慢查询记录如下:

# Query_time: 4294967294 Lock_time: 0 Rows_sent: 10 Rows_examined: 4530
SELECT g.goods_id, g.goods_name, g.shop_price, g.goods_thumb, SUM(og.goods_number) as goods_number FROM `dbebuy`.`ecs_goods` AS g, `dbebuy`.`ecs_order_info` AS o, `dbebuy`.`ecs_order_goods` AS og WHERE g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 AND (g.cat_id IN ('305','228','229','230','231','235','232','233','234','236','278','262','264','263','273','125','126','143','127','139','130','272','73','114','113','124','118','123','115','116','117','135','286','194','280','281','282','283','279','267','268','269','270','271','65','275','276','277','306','47','248','57','58','138','68','70','43','45','44','84','157','251','252','59','302','204','205','206','303','218','217','222','220','307','304','215','213','214','266','207','208','209','210','211','41','295','50','49','284','51','285','52','53','1','6','237','238','240','241','287','239','54','296','297','298','299','301','300','243','244','245','292','246','293','247','294','224','225','226','227','265','291','131','134','132','133','92','253','254','255','256','257','274','258','259','260','261') OR g.goods_id IN ('749','969','1865','1866','2074','2793','2797','2798','2835','2836','2837','2838','2841','2870','2871','2872','2873','2874','3023','3630','3709','3725','3726','3727','3745','3746','3747','3766','3832','3833','3885') ) AND og.order_id = o.order_id AND og.goods_id = g.goods_id AND (o.order_status = '1' OR o.order_status = '5') AND (o.pay_status = '2' OR o.pay_status = '1') AND (o.shipping_status = '1' OR o.shipping_status = '2') GROUP BY g.goods_id ORDER BY goods_number DESC, g.goods_id DESC LIMIT 10;
# User@Host: dbebuy_f[dbebuy_f] @ localhost [127.0.0.1]
# Query_time: 4294967293 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
SELECT c.cat_id, c.cat_name, c.sort_order, a.article_id, a.title, a.file_url, a.open_type FROM `dbebuy`.`ecs_article` AS a LEFT JOIN `dbebuy`.`ecs_article_cat` AS c ON a.cat_id = c.cat_id WHERE c.cat_type = 5 AND a.is_open = 1 ORDER BY c.sort_order ASC, a.article_id;
# Time: 120702 14:54:35
# User@Host: dbebuy_f[dbebuy_f] @ localhost [127.0.0.1]
# Query_time: 4294967294 Lock_time: 0 Rows_sent: 121 Rows_examined: 4089
SELECT cat_id, COUNT(*) AS goods_num FROM `dbebuy`.`ecs_goods` WHERE is_delete = 0 AND is_on_sale = 1 GROUP BY cat_id;

这是什么意思啊,求大侠高手帮忙看看,拜谢!!!

回答:
谢谢了,大家帮忙看看阿!

没人帮忙阿

关键是销售排行里面。有问题。。。。 $sql = 'SELECT g.goods_id, g.goods_name, g.shop_price, g.goods_thumb, SUM(og.goods_number) as goods_number ' .'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g, ' .
$GLOBALS['ecs']->table('order_info') . ' AS o, ' .
$GLOBALS['ecs']->table('order_goods') . ' AS og ' .
"WHERE g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 $where $top10_time " ;
//判断是否启用库存,库存数量是否大于0
if ($GLOBALS['_CFG']['use_storage'] == 1)
{
$sql .= " AND g.goods_number > 0 ";
}
$sql .= ' AND og.order_id = o.order_id AND og.goods_id = g.goods_id ' .
"AND (o.order_status = '" . OS_CONFIRMED ."' OR o.order_status = '" . OS_SPLITED . "') " .
"AND (o.pay_status = '" . PS_PAYED . "' OR o.pay_status = '" . PS_PAYING . "') " .
"AND (o.shipping_status = '" . SS_SHIPPED . "' OR o.shipping_status = '" . SS_RECEIVED . "') " .
'GROUP BY g.goods_id ORDER BY goods_number DESC, g.goods_id DESC LIMIT ' . $GLOBALS['_CFG']['top_number'];

谢谢4楼的兄弟帮忙,哪些页面有这段排名代码阿,是不是删掉就可以了呢?

非常不错,中国服装人论坛支持EC