怎么这么多select * from xxx的啊?

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

慢查询记录的部分sql
应该如何处理呢?

回答:
你写的程序有点问题把,这个SQL是哪个应用?

这块根本又不是自己写的。比如说admin/order.php就有啊:
  1. /* 取得发货单商品 */
  2. $goods_sql = "SELECT *
  3. FROM " . $ecs->table('delivery_goods') . "
  4. WHERE delivery_id = " . $delivery_order['delivery_id'];
  5. $goods_list = $GLOBALS['db']->getAll($goods_sql);
复制代码
  1. foreach($order_id_list as $id_order)
  2. {
  3. $sql = "SELECT * FROM " . $ecs->table('order_info') .
  4. " WHERE order_sn = '$id_order'" .
  5. " AND order_status = '" . OS_UNCONFIRMED . "'";
  6. $order = $db->getRow($sql);
复制代码

神马情况!