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

WBOY
Release: 2016-06-13 12:30:22
Original
776 people have browsed it

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语句?

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template