# My Sql Query very slow

**URL:** <https://forums.percona.com/t/my-sql-query-very-slow/3368>\
**Category:** Other MySQL® Questions\
**Created:** [March 27, 2014, 4:01am UTC](https://forums.percona.com/t/my-sql-query-very-slow/3368 "2014-03-27T04:01:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![selva](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@selva](https://forums.percona.com/u/selva)\
**Post date:** [March 27, 2014, 4:01am UTC](https://forums.percona.com/t/my-sql-query-very-slow/3368/1 "2014-03-27T04:01:49Z")

</div>

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’)

---

<div class="post-metadata">

**Author:** ![rreddy](https://avatars.discourse-cdn.com/v4/letter/r/49beb7/32.png) [@rreddy](https://forums.percona.com/u/rreddy)\
**Post date:** [April 2, 2014, 10:05am UTC](https://forums.percona.com/t/my-sql-query-very-slow/3368/2 "2014-04-02T10:05:06Z")

</div>

Selva, You need to provide at least the “show create table” and “show table status” for all the tables involved without that information, there is very little anyone can offer you.
