Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you REALLY want to optimize that query, put actual values to the date instead of using functions now() and some of the other date functions. Also, make sure that all your inner joins are being used. For instance:</p> <pre><code> SELECT distinct a.id, profi.company, profi.logo, profi.id as profileid , a.job_detail_section as job_detail_section_tmp , a.title as title_tmp , a.location_id as location_id_tmp , a.salary_min as salary_min_tmp , a.salary_max as salary_max_tmp , a.currency as currency_tmp , a.frequency as frequency_tmp , a.job_type as job_type_tmp , a.cat_id as cat_id_tmp , a.job_title as job_title_tmp , a.job_detail as job_detail_tmp , a.status as status_tmp , a.created_date as created_date_tmp , a.effected_date as effected_date_tmp , a.is_hotjob as is_hotjob_tmp , a.user_id as user_id_tmp , a.id as id_tmp , a.views as views_tmp , a.ordering as ordering_tmp , a.apply_type as apply_type_tmp , a.direct_url as direct_url_tmp FROM jos_ja_jobs as a INNER JOIN jos_ja_profiles as profi ON profi.user_id=a.user_id INNER JOIN jos_users as rs ON rs.id=a.user_id and rs.id = profi.user_id WHERE a.status='Approved' AND profi.approved=1 AND rs.block=0 AND a.effected_date &lt;= '2011-06-21' -- Instead have the two dates place there by the application AND( (a.effected_date BETWEEN '2011-06-21' AND '2011-09-21' AND a.is_hotjob=0) OR (a.effected_date BETWEEN '2011-06-21' AND '2011-07-21' AND a.is_hotjob=1) ) ORDER BY a.is_hotjob desc, a.effected_date desc LIMIT 0, 5 </code></pre> <p>Let me know if that helps!</p> <p>Regards, Marcelo</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload