What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

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?

enter image description here

share|improve this question
    
Nope, I see it too. Maybe they were deleted but somehow the counter is out of sync. –  staticx Jun 15 '11 at 12:12
1  
@Changeling - I would suspect caching of the number of answers rather than counting every time. The same happens on the home/questions page too. –  ChrisF Jun 15 '11 at 12:18
    
@ChrisF: Sorry but didn't understand your point well will you explain it please. –  Harry Joy Jun 15 '11 at 12:21
1  
@Harry - 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 perhaps) so if it's not updated when an answer is deleted it will become out of step with the true state. –  ChrisF Jun 15 '11 at 12:24
    
@ChrisF: Ok. Now I understand. Normally answers count update on deleting an answer but don't know what happens in this case. –  Harry Joy Jun 15 '11 at 12:26
    
@ChrisF: This should be the answer. –  staticx Jun 15 '11 at 12:38
    
Looks like they implemented a form of hellbanning... ;) –  John Jun 15 '11 at 16:41

3 Answers 3

up vote 10 down vote accepted

This will resolve itself (sync up) tonight as part of a daily job that runs...well, daily.


The why:
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

share|improve this answer
    
I assume the job was added relatively recently? Some deleted questions are shown with negative answers [10k only]. –  mmyers Jun 15 '11 at 16:44
    
@mmyers - Nope, but it ignores deleted questions –  Nick Craver Jun 15 '11 at 16:59
    
(Since I have no knowledge of the code itself, take this with a grain of salt -) I can understand how AnswerCount would need to be persisted for question lists, but once you are on the question page, couldn't you just display the length of the list of answers that are going to be displayed, instead of AnswerCount? That way you don't have a single page that seems to contradict itself, and at least half-fix this issue (and I'm totally guessing, but it seems like there should be no loss of performance). –  NickC Jul 7 '11 at 23:35

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?

share|improve this answer
4  
Seems kinda silly that the counter would show 2 answers if they were deleted. It would make sense if you were someone who could actually see the answers (10K+ rep or more). –  staticx Jun 15 '11 at 12:16
    
@Changeling Yeah. I guess they do the count before all the filters are applied or it's cached. –  JohnP Jun 15 '11 at 12:18

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .