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

Hi,

It seems that the vast majority of the votes has no userid associated with it:

SELECT COUNT(*) FROM votes WHERE userid IS NULL;     -- Nobody voted?
9211783

SELECT COUNT(*) FROM votes WHERE userid IS NOT NULL;​
674035

Am I missing something? I thought that every vote must have a voter behind it.

share|improve this question

1 Answer 1

up vote 10 down vote accepted

They do have voters behind them...but that data isn't exported. If you look at the ones that do have a userid, you'll see they're all VoteTypeId 5:

SELECT Distinct(VoteTypeId) FROM votes WHERE userid IS NOT NULL;​

5 is a favorite vote...that's the only type of data exposed, all other votes are made anonymous as part of the data export...hopefully for obvious reasons :)


Perhaps a query like this makes a bit clearer illustration:

SELECT Name, 
       Count(*) TotalVotes, 
       SUM(CASE WHEN UserId IS NULL THEN 0 ELSE 1 END) TotalWithUserId
FROM Votes Inner Join VoteTypes ON VoteTypeId = VoteTypes.Id
GROUP BY Name​

Results as of this answer:

Name                    TotalVotes     TotalVotesWithUserId
---------------------------------------------------------------------------------
AcceptedByOriginator    705584          0
BountyClose             12157           0
BountyStart             12342           0
Close                   2666            0
Deletion                270428          0
DownMod                 546646          0
Favorite                674035          674035
Offensive               700             0
Reopen                  56              0
Spam                    1763            0
Undeletion              19541           0
UpMod                   7639900         0
share|improve this answer
    
Seems user IDs are now exported for votes of type 8 (bounty start) as well. –  AirThomas Oct 15 at 23:20

You must log in to answer this question.

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