4 ms·
Redis is great, maybe memcached would serve better for this pupose as some of the comments have mentioned. I just want to point out one thing about his multiple
by arnorhs 16y ago
Redis is great, maybe memcached would serve better for this pupose as some of the comments have mentioned. I just want to point out one thing about his multiple count queries per page.
You can also do a grouped count query in a single query, by using something like:
SELECT COUNT(*) FROM comments WHERE GROUP BY post_id;
From that he gets an array of all the counts, so he can look those up easily.
And that result can also be cached as well, of course.