If you were implementing a blog application - what would you prefer -
Having a counter in the "POSTS" table storing the number of comments
SELECT comment_count
FROM posts WHERE post_id = $id
...or counting the number of comments for a particular post from a "COMMENTS" table:
SELECT COUNT(*)
FROM comments
WHERE post_id = $id
Which one is more optimized?
I would use the second form, COUNT, until I was sure that performance in that particular SQL query was a problem. What you're suggesting in the first is basically denormalization, which is fine and dandy when you know for sure you need it.
Indexes would allow you to perform the second query pretty quickly regardless.