У хостера накапливаются данные по медленным SQL запросам.
Подскажите как по данным этих запросов вычислить в чем проблема и как ее решить.
Вот примеры запросов.
Первый пример
SET timestamp=1361668281;
SELECT DISTINCT u.id as userid, IFNULL(c.id,a.catid) as catid, IFNULL(s.id,a.sectionid) as secid, a.id as id, a.*, a.introtext as itext, a.fulltext as mtext, u.name AS author, u.usertype, u.email as authorEmail, a.created_by_alias as authorAlias, a.created AS dsdate, a.modified as updated, c.name as catName, CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug, CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as catslug
FROM joo_content AS a
LEFT JOIN joo_users AS u ON u.id = a.created_by
LEFT JOIN `joo_categories` AS c on c.id = a.catid
LEFT JOIN `joo_sections` AS s on s.id = c.section
WHERE a.state='1'
AND a.id NOT IN (SELECT content_id FROM joo_content_frontpage)
AND IFNULL(s.id,0) IN (1,3,6,7,8)
AND IFNULL(c.id,0) IN (39,54,92,48,49,65,79,82,87,95,99,100,104,107,110,111,112,113,44,53,42,102,108,60,61,63,72,91,94)
AND a.access <= 0
AND (c.access <= 0 )
AND (s.access <= 0 )
AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2013-02-24 01:10:19')
AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2013-02-24 01:10:19')
ORDER BY a.created DESC LIMIT 10;
Второй пример
SET timestamp=1361291709;
SELECT DISTINCT u.id as userid, IFNULL(c.id,a.catid) as catid, IFNULL(s.id,a.sectionid) as secid, a.id as id, a.*, a.introtext as itext, a.fulltext as mtext, u.name AS author, u.usertype, u.email as authorEmail, a.created_by_alias as authorAlias, a.created AS dsdate, a.modified as updated, c.name as catName, CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug, CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as catslug
FROM joo_content AS a
LEFT JOIN joo_users AS u ON u.id = a.created_by
LEFT JOIN `joo_categories` AS c on c.id = a.catid
LEFT JOIN `joo_sections` AS s on s.id = c.section
WHERE a.state='1'
AND a.id NOT IN (SELECT content_id FROM joo_content_frontpage)
AND IFNULL(s.id,0) IN (1,3,6,7,8)
AND IFNULL(c.id,0) IN (39,54,92,48,49,65,79,82,87,95,99,100,104,107,110,111,112,113,44,53,42,102,108,60,61,63,72,91,94)
AND a.access <= 0
AND (c.access <= 0 )
AND (s.access <= 0 )
AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2013-02-19 16:34:58')
AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2013-02-19 16:34:58')
ORDER BY a.created DESC LIMIT 10;