Home  >  Article  >  Backend Development  >  sql数据查询优化,该怎么处理

sql数据查询优化,该怎么处理

WBOY
WBOYOriginal
2016-06-13 12:30:22776browse

sql数据查询优化
select a.id,rkno,a.packageno as packageno,cust_no,lotno,count(*) as count from `rk_record` as a right join `sys_barcode_1d_y` as b on a.packageno = b.packageno where rkno = '201401030031' group by packageno,lotno order by packageno,lotno asc

rkno,packageno均含索引。

目前查询需要4000多ms,有没有什么方法可以优化该sql语句?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn