GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

My Sql Query very slow

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • My Sql Query very slow

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

  • #2
    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.

    Comment

    Working...
    X