I noticed something interesting earlier while comparing the speed of SMF to another forum system that prides themselves on speed. When you load the same page on an SMF board multiple times, the number of queries used to create that page tends to vary. For example, when loading the boardindex on this board twice in a 30 second period, one time it said it used 9 queries, and the next time it said it used 7 queries. Just curious as to what would cause this.
Because some queries don't have to be run all the time.
For instance whenever there is a new record for the ammount of people online at 1 time it will add 1 more query to update the info.
Also some queries are only run based on how much time has passed. That means that the query won't be run again until the ammount of times has passed. An example of this might be updating the online list, for instance it could be set to only update your last online time every 15 minutes to save from running a query every click.
Which is very important for speed, because when you do redirecting (example: posting!) a lot, which all forums do, you end up hitting the database with WRITE queries TWICE as often as neccessary, which is veyr bad for MySQL 4 query caching.
So if you see a forum that DOESN'T vary, and pretends it's fast, it could still be faster.
-[Unknown]
Cool. I figured it was something like that.
What Are Queires
A query is used everytime information is retrieved from the database
Part true, but a query is also used when inserting and updating as well. ;)
and optimising, creating tables etc etc :P
Don't be so picky :D
Thanks :)
A query is literally when the PHP queries, or asks, the MySQL server a question. This question could be:
Will you insert this for me?
Or....
What is the time now?
Or even:
Can you optimize this table, please?
What's more... MySQL can say no :P.
-[Unknown]
Thanks [Unkown] you are the best at explaining stuff :)
[Unkown] may explain stuff better but at least my name is easier to spell :P
Actually I had a hard time remembering if it was d before g or g before d. :P
Although I have been up 2 days in a row... so my brain is just toast right now. :P
LOL. That's all I have to say. To both of you, Grugde and Chris Should-Be-Sleeping. (I do that myself a lot)
-[Unknown]
Well it's 6PM here right now... I am waiting till about 9 before I go to bed so that I can wake up at a decent hour. I had been waking up at like 10PM and going to sleep durning the day(my whole family does... they work night shifts)... but I am trying to get back to normal.
I have 3 hours to kill... and nothing to do...
Work on the mod site! :P
-[Unknown]
Would you trust me coding that in my current state of mind?
Besides, I havn't even looked at the backend of the mod site yet. :P