Обычный
Просьба ко всем у кого больше 15 тыс топиков выполнить этот запрос[CODE]SELECT t.topic_id, COUNT(p.post_id) AS total_posts, MIN(p.post_id) AS topic_first_post_id, MAX(p.post_id) AS topic_last_post_id, MAX(p.post_time) AS topic_last_post_time, IF(MAX(a.attach_id), 1, 0) AS topic_attachment FROM bb_topics t LEFT JOIN bb_posts p ON(p.topic_id = t.topic_id) LEFT JOIN bb_attachments a ON(a.post_id = p.post_id) WHERE t.topic_status != 2 GROUP BY t.topic_id[/CODE]И напишите сколько записей выдало и время выполнения запроса
Просьба ко всем у кого больше 15 тыс топиков выполнить этот запрос
[CODE]SELECT t.topic_id, COUNT(p.post_id) AS total_posts, MIN(p.post_id) AS topic_first_post_id, MAX(p.post_id) AS topic_last_post_id, MAX(p.post_time) AS topic_last_post_time, IF(MAX(a.attach_id), 1, 0) AS topic_attachment FROM bb_topics t LEFT JOIN bb_posts p ON(p.topic_id = t.topic_id) LEFT JOIN bb_attachments a ON(a.post_id = p.post_id) WHERE t.topic_status != 2 GROUP BY t.topic_id[/CODE]
И напишите сколько записей выдало и время выполнения запроса