The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#7
|
||||
|
||||
![]()
Because it uses a bit more overhead, and it's bad practice because you aren't clearly defining what you are reading from the database. It's similar to using the highest error reporting... you have way more control of what is going on, and you will spot any funny business much faster.
As for the # of queries... while this generally doesn't matter (generally, but i have worked on a site where one query * 5000 active users makes a HUGE difference!) it is good to combine them when there is a relationship between the data from the two queries. The most common is the use of joins to get results from different tables (ex: post + user table). I would have to say this depends greatly on the query. Sometimes two queries is faster if the relationship isn't a good one, which goes back to my normalization comment. Some common improvements you can make: Code:
SELECT * FROM messages LIMIT 10; Code:
SELECT id, body, dateline FROM messages WHERE dateline >= X ORDER BY dateline DESC LIMIT 10 Code:
SELECT * FROM messages WHERE id = 5; Code:
SELECT * FROM user WHERE userid = $message[userid]; Code:
SELECT messages.id, messages.body, messages.dateline, messages.userid, user.username FROM messages LEFT JOIN user USING (userid) WHERE messages.id = 5; |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|