In case you have your own slow SQL query, you can optimize it automatically here.
For the query above, the following recommendations will be helpful as part of the SQL tuning process.
You'll find 3 sections below:
ALTER TABLE `estimatemaster` ADD INDEX `estimatemaster_idx_estimateid` (`estimateid`);
ALTER TABLE `simpleestimatedetails` ADD INDEX `simpleestimatedeta_idx_simpleestid` (`simpleestid`);
ALTER TABLE `vcustomer_prospect` ADD INDEX `vcustomer_prospect_idx_customerid` (`customerid`);
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
)