1 |
0.93 ms |
SELECT COUNT(*) FROM (SELECT p.id, p.title, p.cover, p.text, p.url, p.published, p.date, c.id AS category_id, c.name AS category_name, a.url AS author_url, a.name AS author_name, a.avatar AS author_avatar, (SELECT COUNT(m.id) FROM blog_post_comments m WHERE m.post_id = p.id AND m.approved = 1) AS comments_count FROM blog_posts p INNER JOIN blog_categories c ON p.category_id = c.id INNER JOIN blog_authors a ON p.author_id = a.id WHERE p.published = ? ORDER BY p.priority, date desc) tmp
SELECT COUNT(*) FROM (SELECT p.id, p.title, p.cover, p.text, p.url, p.published, p.date, c.id AS category_id, c.name AS category_name, a.url AS author_url, a.name AS author_name, a.avatar AS author_avatar, (SELECT COUNT(m.id) FROM blog_post_comments m WHERE m.post_id = p.id AND m.approved = 1) AS comments_count FROM blog_posts p INNER JOIN blog_categories c ON p.category_id = c.id INNER JOIN blog_authors a ON p.author_id = a.id WHERE p.published = 1 ORDER BY p.priority, date desc) tmp;
|
2 |
1.10 ms |
SELECT p.id, p.title, p.cover, p.text, p.url, p.published, p.date, c.id AS category_id, c.name AS category_name, a.url AS author_url, a.name AS author_name, a.avatar AS author_avatar, (SELECT COUNT(m.id) FROM blog_post_comments m WHERE m.post_id = p.id AND m.approved = 1) AS comments_count FROM blog_posts p INNER JOIN blog_categories c ON p.category_id = c.id INNER JOIN blog_authors a ON p.author_id = a.id WHERE p.published = ? ORDER BY p.priority, date desc LIMIT 10
SELECT p.id, p.title, p.cover, p.text, p.url, p.published, p.date, c.id AS category_id, c.name AS category_name, a.url AS author_url, a.name AS author_name, a.avatar AS author_avatar, (SELECT COUNT(m.id) FROM blog_post_comments m WHERE m.post_id = p.id AND m.approved = 1) AS comments_count FROM blog_posts p INNER JOIN blog_categories c ON p.category_id = c.id INNER JOIN blog_authors a ON p.author_id = a.id WHERE p.published = 1 ORDER BY p.priority, date desc LIMIT 10;
|