MySQL Forums
Forum List  »  Quality Assurance

SQL running slow
Posted by: Em Siden
Date: December 06, 2011 10:19PM

I am sorry if this topic is wrong because I am new in this forum.
Could you help me with the SQL process. I am using MySQL and connect with Joomla. I want to count all active and inactive job in my database but amount of record too much, So it process too slow. Do you have any trick to solve?

Thank in advance, your answer will appropriate..!!!

My code:


SELECT d.`id`, d.`name`, d.`email` AS `contact_email`, d.`notify`, d.`notify_admin`, d.`logo`, d.`status`
,(SELECT COUNT(j.`id`) FROM `jos_jobboard_jobs` AS j WHERE j.`department` = d.`id` AND j.`published` = 1) AS active
,(SELECT COUNT(j.`id`) FROM `jos_jobboard_jobs` AS j WHERE j.`department` = d.`id` AND j.`published` = 0) AS inactive
FROM `jos_jobboard_departments` AS d;

Options: ReplyQuote


Subject
Views
Written By
Posted
SQL running slow
2034
December 06, 2011 10:19PM
843
January 16, 2012 07:31PM
1310
January 30, 2012 02:10AM
1299
January 29, 2012 08:11PM
856
February 13, 2012 03:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.