9

One of the questions on the Winter Bash 2020 quiz asks how many accounts were created during the first year of Stack Overflow beginning on the day the site was created, on July 31, 2008.

The resource of where to find the answer says that [x] accounts were created during that time, and that answer was judged as correct. However, when I navigated to the lowest non-deleted user ID greater than or equal to [x], the account with that ID was created in May 2009, and there are many other accounts with user ID greater than [x] that were created before July 31, 2009.

Yes, even after an account is deleted, their user ID is still "allocated", but the former URL will lead to a 404 error. User IDs are thus (usually) a reliable indication of the number of accounts created since the time the site was created.

If the number of accounts registered beginning July 31, 2008 and following one year later was only [x], why are there so many more than [x] allocated user IDs during that time?

(As the page specifically states that disclosing answers to any of the quiz questions isn't allowed, I've not written the actual number [x] here. Also, I'm posting this here even though the quiz is global and the hat is awarded on Meta.SE, because the question in its own right would belong here without question if it weren't for this being part of that quiz.)

4
  • 2
    There are certainly some "account merges" or similar that somehow updated the primary key for a user record. It is also worth noting that I expect they used an Identity column in the v1.0 on that id field. Identity is guaranteed to be unique but isn't guaranteed to not leave gaps. Specially on server restarts it is known that identity values will jump ahead a lot. See also: meta.stackexchange.com/questions/291851/…
    – rene
    Dec 26, 2020 at 13:23
  • What is [x]? ;D Jan 2, 2021 at 16:41
  • @VictorVosMottor As Winter Bash isn't over yet, I can't disclose the answer; you'll just have to look yourself, at least for now :)
    – gparyani
    Jan 2, 2021 at 19:49
  • I was just joking ;) I did it myself ;) Jan 2, 2021 at 19:50

1 Answer 1

10

Monica Cellio previously noticed a similar phenomenon, relating to post IDs, namely that the most recent post IDs are greater than the total number of posts. She thought this was odd, since the post ID is a serially incrementing field.

Animuson, a Stack Exchange developer, provided the following explanation:

Oh, but there is a giant flaw in the logic in that not all ID numbers actually get used. SQL Server reserves blocks of ID numbers which all get discarded if the server is ever restarted. Many sites have blocks of ID numbers that never got used because of this. Using the ID number as a determinant for how many posts have ever existed will never be an accurate measurement.

As noted in the comments, this applies to all ID numbers that are automatically incremented, including post IDs and user account IDs.

This is by far the most significant contributor to the gaps. Another minor contributor is the fact that accounts have been merged over the years, either automatically by the system or by explicit moderator intervention. Depending on the direction in which the merger occurred (i.e., whether a newer account was merged into an older account, or vice versa), this could result in shifts or gaps in the user ID space.

You must log in to answer this question.

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