這個查詢需要3秒鐘,我想讓它運行得更快。 請提供任何建議如何優化這個sql查詢
SELECT Concat(e.estimate1, '-', e.estimate2) AS estimateid,
e.estimatetype,
e.createdby,
e.estimateid AS estID,
e.`layoutnumber`,
sd.specno,
sd.samplenumber,
sd.numberon,
c.customerid,
c.custprosname,
c.`custtype`,
(SELECT Count(*)
FROM (SELECT e.estimate1
FROM `simpleestimatedetails` sd,
estimatemaster e,
`vcustomer_prospect` c
WHERE c.customerid IN (e.customernumber, e.prospectnumber)
AND (e.estimate1 LIKE '%1%')
AND (sd.`simpleestid` = e.estimateid)) AS counter) AS
counter
FROM `simpleestimatedetails` sd,
estimatemaster e,
`vcustomer_prospect` c
WHERE c.customerid IN (e.customernumber, e.prospectnumber)
AND (e.estimate1 LIKE '%1%')
AND (sd.`simpleestid` = e.estimateid);
使用[說明](http://dev.mysql.com/doc/refman/5.0/en/explain.html)來分析您的查詢 – VeNoMiS
對不起,我沒有那access.I猜上述查詢doesnot需要任何description.we只需要使用不同的方法 – Samir
對不起,你被分配優化一個查詢,你不能運行EXPLAIN?人們如何期待你這樣做?你有沒有一臺開發機器(你有權利),可以測試重寫,索引和分析? –