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 `regular_challan_sales` ADD INDEX `regular_sales_idx_orderdateactual` (`OrderDateActual`);
ALTER TABLE `regular_challan_sales_details` ADD INDEX `regular_sales_idx_uniqueid` (`UniqueID`);
SELECT
DISTINCT rcs.ID,
rcs.UniqueID,
rcs.ReferanceNo,
rcs.OrderDateActual,
rcs.DelivaredToCus,
rcs.PacketNumber,
rcs.PackingCharge,
rcs.TransportCharge,
rcs.OtherAdjustment,
(SELECT
SUM(rcsd.TotalPrice) AS TotalPrice
FROM
regular_challan_sales_details rcsd
WHERE
rcsd.UniqueID = rcs.UniqueID LIMIT 1) AS TotalPrice
FROM
regular_challan_sales rcs
WHERE
rcs.OrderDateActual >= '2013-12-01'
AND rcs.OrderDateActual <= '2014-05-01'
ORDER BY
rcs.OrderDateActual ASC