我在下面的代码中到底在哪里使用 EXPLAIN 并且任何人都可以建议如何加速/优化此代码(对于 jos_users 表中的 400 万行 Jobseeker 表)
$query = " SELECT DISTINCT a.*,b.name,dl.id id_deg,dl.degree_level,
(SELECT r.hits FROM #__jbjobs_resume_view r WHERE r.jseeker_id=a.user_id AND r.employer_id=$user->id) AS hits,
(SELECT featured FROM #__jbjobs_resume WHERE is_active='y' AND featured=1 AND featured_expire > NOW() AND jseeker_id=a.user_id) as featuredres FROM #__jbjobs_jobseeker a".
" LEFT JOIN #__users b ON a.user_id=b.id ".
" LEFT JOIN #__jbjobs_degree_level dl ON a.id_degree_level = dl.id".
" LEFT JOIN #__jbjobs_custom_field_value c ON c.userid=a.user_id".
" WHERE ".$where."AND b.block='0'".
" ORDER BY featuredres DESC";