142

I was reading an interesting post on another Stack Exchange site, and I hovered the mouse over the vote number and clicked it. Then I realized that I have less than 1000 reputation on that community and I cannot view all the vote count. Why is viewing the vote count that expensive?

30
  • 63
    resources, simply. Votes are saves as an aggregate in the DB. So getting the vote-break is another call. If everyone could do it, we'd lose speed.
    – Patrice
    Commented Mar 4, 2016 at 19:10
  • 7
    Answer on the mother Meta: meta.stackexchange.com/questions/269354/… and meta.stackexchange.com/questions/747/…
    – Andy Mod
    Commented Mar 4, 2016 at 19:13
  • 61
    Quote: "Also: downvotes are still quite rare on Stack Overflow". Ah, those halcyon years. Commented Mar 4, 2016 at 19:17
  • 28
    "View Vote totals" without 1000 rep Commented Mar 4, 2016 at 19:59
  • 1
    @HansPassant A much smaller percentage of posts were made back in the day which needed downvotes/removal. Consequences of a successful website. Commented Mar 4, 2016 at 21:54
  • 84
    The original "resources" excuse sounds like such a Jeff-ism. I'm sure it's not really true today, if it ever was. (Jeff had an occasional habit of making up quick excuses and then stubbornly clinging to them). I'm sure the very capable developers, who have optimized the hell out of this software, could display the vote counts 100% of the time without a meaningful hit to performance, and that the site wouldn't suffer at all if the click-to-reveal feature were lowered to 1 rep today. It's 1000 rep because it's a nice checkpoint in your progress, and that's it. Commented Mar 4, 2016 at 22:22
  • 2
    @HansPassant Good thing, we can confirm this with site analytics 25K tools. In 2008 the ratio between up and downvotes was ~11 and increased steadily to ~21 in Feb 2011. Then the decline began with ~7 now.
    – Artjom B.
    Commented Mar 4, 2016 at 22:39
  • 1
    There are other sites that hide up/down vote counts and/or fuzz the total vote, to discourage someone confirming the result of automated bot voting - or something like that. Is this rationale true for Stack Exchange as well?
    – Nayuki
    Commented Mar 5, 2016 at 1:24
  • 2
    I think @Nayuki might have the answer. Low rep hurdle for seeing the vote count would make it much easier for bots to probe the voting system and find ways to game it. Commented Mar 5, 2016 at 1:29
  • 15
    @ButtleButkus, That doesn't really make sense, since everyone can view vote counts with a userscript, see Bhargav Rao's comment. It's also available for everyone in the timeline, no userscript needed. So if a bot wants the vote counts, it can get them. (I believe this info is also accessible via the Stack Exchange API). Commented Mar 5, 2016 at 8:51
  • 3
    A more credible explanation than "resources" is "we just needed some crack to give out at the 1000 reputation level." I could swear I heard Jeff or one of his homies say that back in the day, but I'm probably misremembering.
    – Cody Gray Mod
    Commented Mar 5, 2016 at 11:53
  • 4
    resources?? in any social media thingy like this you simply store the total and the two components also, of course. look at it this way, no matter what paradigm of data storage (sql, nosql, whatever), if you don't do the calculation on the fly, you'd keep all three components. (just in theory: if you're actually doing it on the fly each time, which would likely be a bit nuts, there's no difference doing all three) of course you keep a count of up and down ikes as well as the total (or just add the two components to get the total). Obviously.
    – Fattie
    Commented Mar 7, 2016 at 1:37
  • @JoeBlow, Sure, they could fix it to have all three available with reasonable performance (remember, this was built 8 years ago, and they probably didn't want to spend time optimizing it back then). Is it worth the development time for SE to optimize it now ? Probably not. Commented Mar 7, 2016 at 8:16
  • 2
    hi @jonascz, nah like any of the zillions of systems like this out there of course it will have (essentially) the up and down component. (it has nothing to do with "performance" or "optimizing", it's a line of code)
    – Fattie
    Commented Mar 7, 2016 at 12:37
  • 1
    @JoeBlow, I can assure you that it's more than just a line of code :-) Commented Mar 7, 2016 at 12:39

4 Answers 4

69

I'm rephrasing the answer from Oded and the answer from Jeff Atwood

The 1000 reputation threshold is a way to limit the use of a somewhat expensive operation, by allowing only a smaller subset of users to perform it, and only on request at that.

The operation is expensive because the breakdown of up- and down votes isn't stored in the posts table. If we assume the SEDE Database schema is somewhat similar we see that the posts table only holds the de-normalized attribute score. To get the breakdown of up and down votes for a question you would need to run something like this:

select sum(case
           when votetypeid = 2 then 1  -- UPMOD
           else 0
           end ) as up
     , sum(case
           when votetypeid = 3 then 1 -- DOWNMOD
           else 0
           end ) as down
from votes 
where postid = 477816

for each post that gets rendered.

Do notice that it isn't impossible for users without the privilege to obtain the vote break down. This userscript from sztupy offers the feature to anyone who installed that script.

15
  • 34
    That would be a reason to not simply load it for every page request but I still don't see the reason for this to be a reputation based privilege. The expense is obviously not intolerable as the facility exists, and the suggested workarounds such as viewing the question timeline will be even more expensive. Commented Mar 5, 2016 at 19:21
  • 2
    @MartinSmith But the timeline is not instantly accessible from the UI except for mods. Somewhere the decision was made to only unlock the vote count split at 1000 rep. I think nobody finds it worth the time to revisit that decision, create a fix that overcomes any existing performance penalty, or reveal other reasons why this feature is privileged based.
    – rene
    Commented Mar 5, 2016 at 19:37
  • 7
    @rene the same problem as everywhere: It doesn't affect ad revenue, so nobody cares. Commented Mar 6, 2016 at 6:59
  • 13
    @JanDvorak More like: the same problem as everywhere: there are only so many hours in the day, so not every minor nuisance can be looked at for hours.
    – IMSoP
    Commented Mar 6, 2016 at 22:02
  • 7
    hey @rene - it seems a bit bizarre you don't also just store the two components. are you speaking as someone who made this system or are you just saying this is what you think
    – Fattie
    Commented Mar 7, 2016 at 1:35
  • 2
    @JoeBlow this is what I think. I have re-read my answer but I can't pin-point exactly where I create the illusion that I made the system. If you can edit the answer to get rid of that would help me lot. My non-native English capabilities might be at play here.
    – rene
    Commented Mar 7, 2016 at 7:42
  • 4
    @JoeBlow score is needed basically all the time, which makes it worth storing denormalized. Apparently up and down counts aren't important enough to justify storing two more fields per post and keep them in sync with the truth in the votes table. And really... that's sensible enough.
    – hobbs
    Commented Mar 7, 2016 at 8:22
  • 3
    What would be so bad about storing one more field per post? Answer: Nothing really. Commented Mar 7, 2016 at 8:42
  • 7
    Fun fact: that userscript got me a StackOverflow T-shirt
    – SztupY
    Commented Mar 7, 2016 at 12:16
  • 2
    "this is what I think" .. oh ok. no, it's almost inconceivable that anyone so inexperienced would have been on the system all these years that they wouldn't think to save the two components. Note too that if it was actually adding in realtime when you click the components button, it would take forever.
    – Fattie
    Commented Mar 7, 2016 at 12:34
  • 1
    hi @rene no you did not in any way imply you work at SO - I was just asking. My English is crap also :) cheers buddy !!
    – Fattie
    Commented Mar 7, 2016 at 12:34
  • 1
    hi @hobbs, nah nobody on Earth would not realise you store the two components of a sum like that. there are more social media engineers out there than anything, its' a well-worn field
    – Fattie
    Commented Mar 7, 2016 at 12:35
  • 2
    @Trilarion A post could have a cached vote count which is allowed to go stale (a flag indicates when it is valid). Whenever the question is voted on, the flag is flipped to indicate that the count is no longer valid. When the vote count needs to be displayed, and is invalid, then it is recalculated and marked valid. As an optimization, when the display is being done for the sake of the user who altered the vote count, the local javascript logic in the browser can avoid recalculating the count; it can just sneakily adjust the value displayed according to the voting action which the user took.
    – Kaz
    Commented Mar 7, 2016 at 18:49
  • 1
    My guess is that performance or implementation difficulty is not really the problem here. The answer of SergeyA about it just being a privilege describes the issue more clearly. Commented Mar 8, 2016 at 9:09
  • @rene You are saying that it is easier to read from the denormalized value score. Why not just retain two denormalized values, upvotes and downvotes? Commented Feb 25, 2017 at 14:38
26

Short answer - it is a badge.

Long answer

Stack Overflow needs to keep revenue coming. To keep revenue coming, it needs the users to keep coming. To keep users coming, it needs to lure them. How do you lure askers? By promising them answers. How do you lure answer providers? By promising them some form of compensation. How can Stack Overflow compensate? By giving the sense of accomplishment, by giving a badge. And if it can add a bit of substance to the badge - the badge becomes a more desired prize. By slowly giving those perks with every new milestone of rep achieved, SO keeps answer providers filled with self-importance (I can see vote counts!, and you, sir, can not!), so that they keep providing answers.

Or, in another words, since SO can't compensate you for the answer with money, it compensates you with the privilege.

5
  • 2
    I like this answer !
    – machine_1
    Commented Mar 7, 2016 at 16:54
  • 2
    I always wondered if this really works like that? I never gave much about the badges but I liked helping. I actually would have contributed totally for free without any compensation. So now say that I will only continue contributing if SO grants this privilege to everyone. According to the logic presented in this answer, this is actually the only way of changing the rules of the game. So, I demand no payment as payment!! Only thing left to do: convince majority of SO user of the wisdom of that. :) Commented Mar 8, 2016 at 9:05
  • I neither like nor dislike this comment. Commented Mar 8, 2016 at 11:11
  • Excellent answer. I was confused by the previous one, that implied it was a performance issue when clearly it is not. Then I guess my main question is why this particular feature is 1000, not 100 or something. Most of the other useful badges are given out pretty early on. Commented Feb 25, 2017 at 14:41
  • 1
    Not a badge, a privilege.
    – philipxy
    Commented Feb 28, 2021 at 10:07
10

I think it's part of Stack Exchange principle to earn some privileges with participation to the site. The breakdown is a small privilege that you earn at a given point. It's not very useful but it's nice to have it and you're happy to have it once you reach 1k.

In fact, I would even say that if you didn't have to earn it, you wouldn't find it that nice a feature !

The load on the DB may be an historical justification. But as said in the comments, it would be easy to make the feature more scalable if this was needed or a priority. But in the end, what matters to evaluate a post is the score, not the breakdown.

If you had all features unlocked when creating your account on stackoverflow, you wouldn't have the incitation of the next privilege you track to increase your reputation. For some users it doesn't count, for some it does. In the end, I think it adds to the global motivation of the community (as badges, reputation and all the other metrics that have nothing to do with asking & answering questions)

8
  • 1
    It's not only a privilege (like more comfortable chairs) but also a useful information making the use of the site more efficient. There is a case for displaying it earlier. Surely we could have other nice privileges instead like bigger avatars, ... whatever. Commented Mar 8, 2016 at 8:59
  • I don't really see how it makes the usage of the site more efficient ... Commented Mar 8, 2016 at 9:55
  • 2
    It does. 4 upvotes, no downvote mean that this particular contribution is rather less popular but unanimously found to be good. 10 upvotes and 6 downvotes mean that this particular contribution is very visible but also highly controversial. Yet the sum is the same in both cases. Having the two dimensions separated allows you to infer better on controversity and popularity. That's useful and makes you use SO more efficiently. Commented Mar 8, 2016 at 10:04
  • Fair enough (even though for your own question, the reputation earned / loss gives you a good hint), but that's a rather 'advanced' tool. Therefore keeping it for experienced users make sense. Now the initial remark about various Stack Exchange sites is valid: a user that knows the concept of one site knows the concept of others so he could benefit from the feature. But that's also an incentive to contribute more to this community. Commented Mar 8, 2016 at 13:27
  • 1
    I don't think it is an 'advanced' tool. You could see it as such, but it is just the sum of all positive votes and the sum of all negative votes, separately. If this is an advanced feature, what about search for example? Commented Mar 8, 2016 at 14:20
  • It's not complex to understand or implement but it doesn't mean it's simple to use effectively. Commented Mar 8, 2016 at 15:00
  • I find it very simple to use effectively although I also find that I do not need to use it all the times, so it's not that important but that could be said of many other things too. Also, in general, I think that the feature is not overly difficult to use effectively. It just gives you a more detailed view into what people really thought about a contribution and with a bit of experience using it everyone can estimate with good accuracy what different directions in the 2dimensional up/downvote space mean. Commented Mar 9, 2016 at 8:55
  • "It's not a design flaw, it's a fringe benefit." -1, not directed at you (this is a good writeup), but at SE. Oh well.
    – jrh
    Commented Aug 10, 2017 at 13:34
7

I think 1000 reputation is too high a level for this, and that anyone that can downvote (125 reputation) should be able to see the vote counts.

6
  • I think around 500 should be fair. 125 is easily reached. Also, at such low rep, the user might be inclined to vote after seeing + and -. Commented Mar 7, 2016 at 18:39
  • 2
    @EvanCarslake: I agree, 1000 seems high for what appears to be a fairly insignificant power. When first starting out, 1k is a milestone. Think about it: at 2k rep, you can edit posts directly, and at 3k rep you can start voting to close questions. At 1k... you can see how a number is summed. It feels underwhelming, even though (as other answers have explained) there's a technical reason for this. I'm not arguing to actually have this number changed, but I did want to give my $0.02
    – Mage Xy
    Commented Mar 7, 2016 at 18:55
  • 5
    Everyone, can we all agree on 367 as a good compromise? Commented Mar 8, 2016 at 20:28
  • I agree that it should be lower. I thought 100 at first, but perhaps that is too low considering some of the automatic 100 bonuses given out. Maybe ... 200? 500? 1000 is definitely too high on some of the peripheral stack exchange sites. Maybe it could vary by site? Commented Feb 25, 2017 at 14:46
  • @EvanCarslake Certainly people would be inclined to vote based on that information, but they already vote based on the total score. I've seen a number of well-thought out, completely factually accurate answers nosedive after they went below -5. People just figure that the other people know well enough that they'll follow the pack. I try to upvote these answers when I see them, even when they are not the top, best answer, but I can only do so much. Commented Feb 25, 2017 at 14:48
  • 750!!!!!!! PLEASE! Commented Apr 27, 2020 at 18:07

You must log in to answer this question.

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