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

How does Stack Overflow keep track of the number of questions under a tag as well as the number of votes, views, answers per question, etc? I'm just eager to know if they maintain a separate table or do a count query every time.

share|improve this question
1  
Take a look at an open source alternative: osqa.net check their database schema. –  Marcelo Sep 1 '11 at 17:57

2 Answers 2

Not quite a duplicate, but a fellow MSO user posted an interesting writeup about this at Dissecting the Stack Overflow views counter. Excerpt:

From what I can tell there is now a JavaScript section in each answer page (used to be CSS in 2008):

<script type="text/javascript" src="/posts/3590653/ivc/a947"></script>
<noscript>
    <div><img src="/posts/3590653/ivc/a947" class="dno" alt=""></div>
</noscript>

The last part of the URL - a947 - seems to be dynamically generated. It is changed every 15-20 minutes and is the same for all questions and presumably users (I tried anonymous access, changing my IP address, it stays the same during the interval).

share|improve this answer

Just use a database of questions and answer.

Each user has a unique ID to query on.

share|improve this answer

You must log in to answer this question.

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