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

Does the system have to do a COUNT(*) query on the user's votes for the day, then determine if the daily limit is reached? Or is there another method to doing this?

share|improve this question
Is this really relevant? – alex Jan 17 '11 at 17:23
@alex: not to the operation of SO, but perhaps to the learning of anyone interested. – John Jan 17 '11 at 18:25
@John Then it really should belong to SO. – badp Jan 24 '11 at 16:35
@badp: "Belong to SO"? Do you mean "belong on SO"? According to the FAQs, questions about the core Stack Exchange engine that powers all Stack Exchange websites are welcome here. – John Jan 24 '11 at 17:28

2 Answers 2

up vote 10 down vote accepted

We do exactly what you describe.. we count(*) for utc today on the existing votes every time you vote, and when you hit the limit, we tell you to come back in (n) hours to vote more!

share|improve this answer

If you're asking if there's another way to do so, then obviously yes.

In the user table, add a column for each vote limit. Reset the columns every night to the appropriate vote allowance. Decrement the value every time you use a vote. Check the value to know how many votes are left.

Similarly, for rate limited actions, add a column with the timestamp of the last time you changed something. Do a date diff to know how much time has passed and deny or allow accordingly.

Is this what SE does? I don't know. It might be. It might not. I have never really done databases, so I don't know how horrible this idea is.

share|improve this answer

You must log in to answer this question.

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