1.12 ms (43.48%)
|
1 |
SELECT p.id, p.title, p.cover, p.text, p.url, p.published, p.created_at, 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, (SELECT COUNT(i.id) FROM blog_post_images i WHERE i.post_id = p.id) AS images_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 INNER JOIN blog_tags t ON t.post_id = p.id WHERE (t.tag_id = ?) AND (p.published = ?) ORDER BY p.priority, created_at desc LIMIT 10
SELECT p.id, p.title, p.cover, p.text, p.url, p.published, p.created_at, 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, (SELECT COUNT(i.id) FROM blog_post_images i WHERE i.post_id = p.id) AS images_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 INNER JOIN blog_tags t ON t.post_id = p.id WHERE (t.tag_id = 7) AND (p.published = 1) ORDER BY p.priority, created_at desc LIMIT 10;
|
0.60 ms (23.11%)
|
1 |
SELECT COUNT(*) FROM (SELECT p.id, p.title, p.cover, p.text, p.url, p.published, p.created_at, 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, (SELECT COUNT(i.id) FROM blog_post_images i WHERE i.post_id = p.id) AS images_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 INNER JOIN blog_tags t ON t.post_id = p.id WHERE (t.tag_id = ?) AND (p.published = ?)) tmp
SELECT COUNT(*) FROM (SELECT p.id, p.title, p.cover, p.text, p.url, p.published, p.created_at, 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, (SELECT COUNT(i.id) FROM blog_post_images i WHERE i.post_id = p.id) AS images_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 INNER JOIN blog_tags t ON t.post_id = p.id WHERE (t.tag_id = 7) AND (p.published = 1)) tmp;
|