The query:
SELECT COUNT(*) as count_all, posts.id as post_id FROM posts INNER JOIN votes ON votes.post_id = posts.id GROUP BY posts.id; <
SELECT COUNT(*) as count_all, posts.id as post_id FROM posts INNER JOIN votes ON votes.post_id = posts.id GROUP BY posts.id;
Using OVER() and LIMIT 1:
OVER()
LIMIT 1
SELECT COUNT(1) OVER() FROM posts INNER JOIN votes ON votes.post_id = posts.id GROUP BY posts.id LIMIT 1;