Jump to content
Awoo.

"Views"


Vasco

Recommended Posts

Not too relevant but I find it odd that some threads have 0 views, even when they have 2 or 3 replies already. I noticed this in the chit chat section specifically.

I clicked in a topic that was said to have no views, and when I went back that still had not changed. Any specific reason for this?

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • bmn

    1

  • Diz

    1

  • Vasco

    1

Popular Days

Top Posters In This Topic

Well yeah, simple answer really. That is, if it's just like it was at the old SSMB before it was wiped.

It was done on purpose. The view info thingy was modified to update on a much more rare basis in order to speed up the SSMB since the site was somewhat slow back then. That's at least what I got from that.

B'man or someone else who knows more could reply to this topic when they read this, as I do not know much, although I do know (I think) that it is intentionally and not something they are going to change anytime soon, so unless that's incorrect, I'll lock this for now. ^^

Link to comment
Share on other sites

Do I have to? ¬_¬

The views counter is stored in the same database table as all the data for topics. With every page view, it has to be incremented, so the topics table has to be both read and written to.

MySQL (the database engine) has a particular way of handling write operations; it waits until any existing read operations are finished, then locks the table for all use, writes to it, and unlocks it. Stops things from going wrong with reading from half-written tables etc. With a heavily-read table like topics, write operations cause delays since any topic page load delays any other operations due to the lock. When there are only read operations, multiple reads can be done at the same time without any delays.

On top of that, MySQL uses query caching so that repeated views of the same page can load the data much quicker. However, when a table is written to, cached data relating to that table is thrown away. If the views are updated immediately, this means the cache is thrown out immediately, and having a cache for the topics table actually makes the performance worse.

Thus IPB has a mode that temporarily stores topic views in a separate table. It gets rid of the necessity of locking the topics table (except when a topic actually changes; for example when a post is made), improving topic load times and reducing the chance of accidentally corrupting what is probably the second most important table on the forum. The view counts are retroactively added to the topics table at 3 hour intervals, meaning that a topic can erroneously appear to have no views for up to 3 hours.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

You must read and accept our Terms of Use and Privacy Policy to continue using this website. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.