Hi, some one help me please, I have below query , It is very very slow just 1000 Records it taking 10 minits
SELECT DISTINCT
vtiger_salesorder.salesorder_no,
vtiger_salesorder.salesorderid,
vtiger_salesorder.orderdate,
vtiger_salesorder.invoicedate,
vtiger_salesorder.invoiceno,
(SELECT
softMax_events.description
FROM
softMax_events
WHERE vtiger_salesorder.salesorderid = softMax_events.orderNum
AND softMax_events.appointTyp=‘60’ AND softMax_events.status = ‘0’ Limit 0,1) As daterequirednotes,
(SELECT
DATE_FORMAT(softMax_events.s_date,‘%d-%m-%Y’)
FROM
softMax_events
WHERE vtiger_salesorder.salesorderid = softMax_events.orderNum
AND softMax_events.appointTyp=‘60’ AND softMax_events.status = ‘0’ Limit 0,1) As AppDateReq,
(SELECT
DATE_FORMAT(softMax_events.s_date,‘%d-%m-%Y’)
FROM
softMax_events
WHERE vtiger_salesorder.salesorderid = softMax_events.orderNum
AND softMax_events.appointTyp=‘61’ AND softMax_events.status = ‘0’ Limit 0,1) As FITTERDate
FROM
vtiger_salesorder
INNER JOIN vtiger_inventoryproductrel ON vtiger_inventoryproductrel.id = vtiger_salesorder.salesorderid
Inner Join vtiger_crmentity ON vtiger_salesorder.salesorderid = vtiger_crmentity.crmid
WHERE (vtiger_salesorder.sostatus = ‘Order’) and ( vtiger_crmentity.deleted<>‘1’)