このクエリは 3 秒かかっているので、もっと速く実行したいと考えています。提案があれば教えてください
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 );