MariaDB [mydb]> show full processlist; +--------+----------+-----------+-------+---------+------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+ | Id | User | Host | db | Command | Time | State | Info | Progress | +--------+----------+-----------+-------+---------+------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+ | 159392 | mydb | localhost | mydb | Query | 0 | NULL | show full processlist | 0.000 | | 159653 | mydb | localhost | mydb | Query | 55 | Sending data | SELECT series.id, series.title, series.catid, series.language, series.hits, series.home, series.alias, series.avatar, series.state, series.ordering, created_by, series.checked_out, series.checked_out_time, series.publish_up, series.publish_down,l.title AS language_title, l.image AS language_image,uc.name AS editor,ua.name AS author_name,c.title AS category_title,(SELECT COUNT(DISTINCT sermons.id) FROM mydb_sermon_sermons AS sermons WHERE sermons.series_id = series.id AND sermons.id > 0 AND sermons.state = 1) AS sermons FROM `mydb_sermon_series` AS series LEFT JOIN `mydb_languages` AS l ON l.lang_code = series.language LEFT JOIN mydb_users AS uc ON uc.id = series.checked_out LEFT JOIN mydb_users AS ua ON ua.id = series.created_by LEFT JOIN mydb_categories AS c ON c.id = series.catid WHERE (series.state IN (0, 1)) GROUP BY series.id ORDER BY series.title asc LIMIT 20 | 0.000 | +--------+----------+-----------+-------+---------+------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+ MariaDB [mydb]> explain SELECT series.id, series.title, series.catid, series.language, series.hits, series.home, series.alias, series.avatar, series.state, series.ordering, created_by, series.checked_out, series.checked_out_time, series.publish_up, series.publish_down,l.title AS language_title, l.image AS language_image,uc.name AS editor,ua.name AS author_name,c.title AS category_title,(SELECT COUNT(DISTINCT sermons.id) FROM mydb_sermon_sermons AS sermons WHERE sermons.series_id = series.id AND sermons.id > 0 AND sermons.state = 1) AS sermons FROM `mydb_sermon_series` AS series LEFT JOIN `mydb_languages` AS l ON l.lang_code = series.language LEFT JOIN mydb_users AS uc ON uc.id = series.checked_out LEFT JOIN mydb_users AS ua ON ua.id = series.created_by LEFT JOIN mydb_categories AS c ON c.id = series.catid WHERE (series.state IN (0, 1)) GROUP BY series.id ORDER BY series.title asc LIMIT 20; +------+--------------------+---------+--------+---------------+--------------+---------+--------------------------+-------+----------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+--------------------+---------+--------+---------------+--------------+---------+--------------------------+-------+----------------------------------------------+ | 1 | PRIMARY | series | ALL | NULL | NULL | NULL | NULL | 262 | Using where; Using temporary; Using filesort | | 1 | PRIMARY | l | eq_ref | idx_langcode | idx_langcode | 28 | func | 1 | Using where | | 1 | PRIMARY | uc | eq_ref | PRIMARY | PRIMARY | 4 | mydb.series.checked_out | 1 | | | 1 | PRIMARY | ua | eq_ref | PRIMARY | PRIMARY | 4 | mydb.series.created_by | 1 | | | 1 | PRIMARY | c | eq_ref | PRIMARY | PRIMARY | 4 | mydb.series.catid | 1 | | | 2 | DEPENDENT SUBQUERY | sermons | ALL | PRIMARY | NULL | NULL | NULL | 40042 | Using where | +------+--------------------+---------+--------+---------------+--------------+---------+--------------------------+-------+----------------------------------------------+ 6 rows in set (0.00 sec)