Announcement

Collapse
No announcement yet.

Insert vs Modify

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Insert vs Modify

    As I understand it vBulletin has for some time maintained a system of only updating the number of posts or number of views of a thread every once in a while, and whenever a thread is viewed, for example, it'll just INSERT an extra view while it later tallies these up and MODIFY's the table with the new amount. I have a file download system I've been using for a while and it simply updates download counts on each file when someone else downloads a file...I was wondering what kind of performance gain is achieved by the method vBulletin uses...
    Seriously! - The Definitive Home of All Things Serious
    Seriously! Forums

    To recieve support on these forums, enter your username here.

  • #2
    You'll only notice it when your site gets really big. Updating the thread table on larger forums will cause delays due to table locking if you update it with every thread view. If you keep track of the thread views separately and only update the thread table every hour, it's not that big of an impact.

    Comment


    • #3
      It gets around 6000-7000 downloads a day, so the counter is updated that many times...would it be worth it for me to implement something similar in this or not?
      Seriously! - The Definitive Home of All Things Serious
      Seriously! Forums

      To recieve support on these forums, enter your username here.

      Comment


      • #4
        6000 to 7000 updates to a table per day is relatively seen not much. If it were per hour it would be different, but per day is ok.

        Comment


        • #5
          What about in instances where it may spike to 6000-7000 per hour...what kind of an effect would that have?
          Seriously! - The Definitive Home of All Things Serious
          Seriously! Forums

          To recieve support on these forums, enter your username here.

          Comment


          • #6
            6000 queries per hour means on average one query per 1.43 seconds. As long as those queries don't take longer than that and are very heavy on the server you'll be fine.

            Comment


            • #7
              One simple calculation:

              Let's take a website with 10 users online at the same time and all of the enter a page which executes 10 queries (checking for new messages, checking for own messages etc.).. That would be 100 queries. This example is not very realistic but it should show you that 1.43 seconds execution time is much.. Much more than the most queries need
              That's the end of that!

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...
              X