In this question; it show 2 answers as header but under it there are no answers. Am I the the only one to see this? Is it because of some restriction on me due to reputation? or is it a bug?
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.Sign up to join this community
This will resolve itself (sync up) tonight as part of a daily job that runs...well, daily.
We normally sync up the answer counts when a post is added or deleted, however there's an exception to this rule: when a user is deleted.
There's a lot of data associated with a user, to clean that up is quite a transaction already, bringing in other posts they don't own into the equation greatly affects the impact a delete has (as well as the lock volume generated on the database side).
When a user is deleted (if their posts are deleted as well - in the case of spammers this is often true) we just soft delete the posts, not re-syncing the parent answer counts.
However we don't just ignore this, all answer counts are synced up once a day to correct any denormalization issues like this
It does have 2 answers. It's just that both of them are actually deleted answers.
Related to what is going on here : Why my account is not there?
I suspect that it's caching of the number of answers rather than counting every time. The same happens on the home/questions page too. If an answer is deleted it takes a little while for the count to catch up.
I don't know the code base, but it could be that finding the answers to a question in the database is a relatively expensive operation - especially if you're not going to display them. Therefore it makes sense to hold an "AnswerCount" against the question. This will only be updated from time to time (when a new answer is posted for example) so if it's not updated when an answer is deleted it will become out of step with the true state.
I don't know why it wouldn't be updated when an answer is deleted. You'll have to wait for one of the devs to drop by to get an answer for that.