0

嗨,我正在从多个表中检索并显示结果,但这需要很长时间。

以下是我的数据库代码:

"SELECT count(distinct KGBupdate.gsxNo) as sat FROM KGBupdate 
    RIGHT JOIN ContactCenter ON KGBupdate.ackNo=ContactCenter.ackNo
    LEFT JOIN CustomerFeed ON ContactCenter.callId = CustomerFeed.callId
    WHERE date(ContactCenter.callClose) BETWEEN '".$start."' AND '".$end."'
    AND KGBupdate.gsxNo!=''
    AND ContactCenter.callStatus = 'Close'
    AND CustomerFeed.overall IN ( 1, 2 ) 
    AND ContactCenter.location='".$location[$i]."' "

使用索引加速的方法是什么

提前致谢。

4

1 回答 1

0

尝试这个:

SELECT count(distinct KGBupdate.gsxNo) as sat FROM KGBupdate 
    RIGHT JOIN ContactCenter ON KGBupdate.ackNo=ContactCenter.ackNo and ContactCenter.callStatus = 'Close' and ContactCenter.location='".$location[$i]."' "
    LEFT JOIN CustomerFeed ON ContactCenter.callId = CustomerFeed.callId and CustomerFeed.overall IN ( 1, 2 ) 
    WHERE date(ContactCenter.callClose) BETWEEN '".$start."' AND '".$end."'
    AND KGBupdate.gsxNo!=''
于 2013-07-31T07:00:50.383 回答