News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Number of Queries in "Page created in..." string

Started by Oldiesmann, April 07, 2004, 12:11:53 PM

Previous topic - Next topic

Oldiesmann

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.
Michael Eshom
Christian Metal Fans

Chris Cromer

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.
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

[Unknown]

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]

Oldiesmann

Michael Eshom
Christian Metal Fans


Grudge

A query is used everytime information is retrieved from the database
I'm only a half geek really...

Chris Cromer

Part true, but a query is also used when inserting and updating as well. ;)
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Grudge

and optimising, creating tables etc etc :P

Don't be so picky :D
I'm only a half geek really...


[Unknown]

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]

Homie

Thanks [Unkown] you are the best at explaining stuff  :)

Grudge

[Unkown] may explain stuff better but at least my name is easier to spell :P
I'm only a half geek really...

Chris Cromer

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
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

[Unknown]

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]

Chris Cromer

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...
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

[Unknown]


Chris Cromer

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
Chris Cromer

"I was here, here I was, was I here, sure I was" - The little voice in my head.

Advertisement: