View Full Version : Insert vs Modify
DarkReaper
Thu 6th Jan '05, 3:08pm
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...
Icheb
Fri 7th Jan '05, 9:34pm
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.
DarkReaper
Sat 8th Jan '05, 4:00am
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?
Icheb
Sat 8th Jan '05, 8:16am
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.
DarkReaper
Wed 11th May '05, 5:30am
What about in instances where it may spike to 6000-7000 per hour...what kind of an effect would that have?
Icheb
Wed 11th May '05, 6:29am
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.
MrNase
Wed 11th May '05, 9:28am
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 :)
vBulletin® v3.8.0 Release Candidate 1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.