30

I wanted to know which user on Stack Overflow has posted the most. So I ran this SQL query:

select top 10 count(*) as PostCount, OwnerUserId from Posts
group by OwnerUserId
order by count(*) desc

I believe the answer is Gordon Linoff, followed up by Jon Skeet.

However, if we look at the result:

PostCount   OwnerUserId
505599  
55639       1144035
34761       22656
21972       548225
21517       29407
21496       6309
21280       115145
20399       1491895
19568       100297
19427       19068

We can see that there is another user with an astonishing number of posts (505599), but this user doesn't have an OwnerUserId, or one that can be displayed somehow.

At first, I thought it was the Community Bot, but that's not the case either.

What's going on? Why is the OwnerUserId for this user not displayed? I don't think it's an actual person, but is it?

3
  • 3
    And here I'm just surprised someone have done more than 20k more answers than Jon Skeet. May 26, 2019 at 23:07
  • 1
    @ClausJørgensen on the other hand, Linoff posted 0 questions while Skeet posted 50. By that measure Skeet posted ∞% more questions than Linoff! May 27, 2019 at 4:39
  • 1
    @ClausJørgensen I believe this is the only Who has done best? kinda query that the answer is not Jon Skeet. May 27, 2019 at 6:36

4 Answers 4

27

As per this Meta Stack Exchange FAQ post

OwnerUserId (only present if user has not been deleted; always -1 for tag wiki entries, i.e. the community user owns them)

So filtering out OwnerUserId IS NOT NULL AND OwnerUserId <> -1 is the correct way to get the result:

SELECT TOP 10 
    OwnerUserId AS [User Link], 
    COUNT(*) AS PostCount
FROM Posts
WHERE OwnerUserId IS NOT NULL AND OwnerUserId <> -1
GROUP BY OwnerUserId
ORDER BY COUNT(*) DESC;
2
  • 3
    BTW, when I asked it on StackOverflow, you suggested that I should ask it on Meta.StackExchange.com, I didn't notice StackExchange and asked it here. Now I realize it would've been better there. So I'll keep that in mind, and thank you. May 26, 2019 at 8:51
  • 1
    another glaring example of why null is the Billion Dollar Mistake". Probably more like Trillion now. There is no reason to have null in this column, I would have just converted all the *deleted userid to a negative of themselves or at least -1 so they could be excluded and sorted without having to deal with null and its non-standard behaviors from RDBMS to RDBMS.
    – user10677470
    May 27, 2019 at 21:43
22

These are posts by deleted users. They also include dissociated posts.

This can be confirmed by the following query:

select top 10 Id as [Post Link], OwnerUserId  from Posts where OwnerUserId is NULL;
10

These are posts from users that don't exist on Stack Overflow - either they were deleted or the post was migrated from another Stack Exchange site where the author has an account (but doesn't have one on Stack Overflow).

9

As already explained in the other answers, the count includes posts from users who have deleted their accounts. For those users, OwnerUserId is no longer available. OwnerDisplayName is still populated (as far as I know, typical with the name of the form user12345).

Here is a query modified to use group by OwnerUserId, OwnerDisplayName: Users with most posts (including deleted users).

I have checked a few other sites, such as Physics, MathOverflow, Mathematics. It seems that a deleted account with many posts is not an everyday occurrence, but it happens. (It seems quite natural that a user who posted many questions/answers and invested quite a lot of time into site is not that keen on leaving it.)

You must log in to answer this question.

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