mysql 中使用了连接查询,但是使用 limit 后查询时间反而更长了,没弄明白什么原因,sql 如下
SELECT `t`.* FROM `order_main` `t` LEFT JOIN `base_supplier` `c` ON `t`.`OUTSIDE_SALE_ORG_ID` = `c`.`ID` LEFT JOIN `dict_type` ON `t`.`ORDER_STATUS` = `dict_type`.`ID` LEFT JOIN `base_user` ON `t`.`CREATE_USER_ID` = `base_user`.`ID` LEFT JOIN `base_user` `m` ON `t`.`SALES_MAN` = `m`.`ID` LEFT JOIN `order_ht_status_log` ON `t`.`ORDER_ID` = `order_ht_status_log`.`ORDER_ID` LEFT JOIN `base_user` `lu` ON `order_ht_status_log`.`CREATE_USER_ID` = `lu`.`ID` WHERE `order_prod_type` = 25 AND `t`.`cancel_flag` = 0 AND `ORDER_VALID_STATUS` = 1 AND `t`.`DOCKING_TYPE` = 556 AND `order_ht_status_log`.`ORDER_STATUS` = 198 AND `order_ht_status_log`.`BEFORE_STATUS` = 313 AND `t`.`CREATE_TIME` BETWEEN ‘2018-03-01 00:00:00‘ AND ‘2018-03-08 23:59:59‘ GROUP BY `t`.`ORDER_ID`
如果添加 limit 条件执行时间是当前sql的70~80倍,不知道什么原因,求大神解惑