10
回答
奇葩mysql查询缓慢问题
科大讯飞通用文字识别100000次/天免费使用。立即申请   
故障详情:在订单表加入了查询微信绑定ID和微信图片的查询 点开页面的时候非常缓存 数据库已经清理优化过 依然是很卡 但是单独的微信用户信息页面是一点不卡的 最后去掉了联合查询的微信表就没问题了 查询代码如下:
/* 查询 */
        $sql = "SELECT wx.*,o.order_id, o.order_sn, o.add_time, o.order_status, o.shipping_status, o.order_amount, o.money_paid," .
                    "o.pay_status, o.consignee, o.address, o.email, o.tel, o.extension_code, o.extension_id, " .
                    "(" . order_amount_field('o.') . ") AS total_fee, " .
                    "IFNULL(u.user_name, '" .$GLOBALS['_LANG']['anonymous']. "') AS buyer ".
                " FROM " . $GLOBALS['ecs']->table('order_info') . " AS o " .
                " LEFT JOIN " .$GLOBALS['ecs']->table('users'). " AS u ON u.user_id=o.user_id ".
                " LEFT JOIN wxch_user wx ON u.wxid = wx.wxid ".  $where .
                " ORDER BY $filter[sort_by] $filter[sort_order] ".
                " LIMIT " . ($filter['page'] - 1) * $filter['page_size'] . ",$filter[page_size]";
举报
imnpc
发帖于3年前 10回/526阅
顶部