|
Joined: May 2002
Posts: 20
Newbie
|
Newbie
Joined: May 2002
Posts: 20 |
Boards are at www.tigerboards.netMy question is, if we want to whittle down the queries do we take the calls for queries out of the .php files in the threads directory, or edit them out of the template file. Last time, we made many changes to the template file and it slowed things down a lot. My guess is that the .php files were still trying to access the info in the template file thus slowing things down. I guess, exactly what I need to know is, since we don't use the approve post or the showflat features, can I take that out of the php file without screwing anything up? Also, if I wanted to whittle down what's in the extra info box, what's the safe way to do that. Thanks, as always, :-) Chris
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
The templates only display the information that the .php file has already obtained. So that won't have any bearing. No queries are done in the templates - they are just templates.
To remove actual queries to the DB that's done in the .php file - anytime you see an actual query being done to the database.
The stuff you describe taking out - I believe is already part of an existing query - so there's no real gain unless you can remove the whole query (vs just removing one little bit obtained from a query).
|
|
|
|
Joined: May 2002
Posts: 20
Newbie
|
Newbie
Joined: May 2002
Posts: 20 |
How do I discern a whole query from a partial one?
Thanks
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Anywhere in the script you see the do_query function used - that's performing a query.
What I mean is that if the Query is
SELECT U_Username, U_Email, U_TotalPosts
And you remove just one of those items:
SELECT U_Username, U_Email
That's not really saving much, as the query is still being done. To trim whole queries would be major cutting of some of the features.
|
|
|
|
Joined: Oct 2003
Posts: 2,305
Old Hand
|
Old Hand
Joined: Oct 2003
Posts: 2,305 |
I would look more into making sure that MySQL is optimized. I would look into tweaking that rather then this application. If your having issues with queries I would look there first.
|
|
|
|
Joined: Aug 2002
Posts: 1,191
Kahuna
|
Kahuna
Joined: Aug 2002
Posts: 1,191 |
Also in theory it is better if you make a call to the database and start printing the information on the screen directly (i.e. the template is inside the php file). The reason for this is that some time is spent for the array of information to be populated with the database call in the php file and then the template file traverses the array to display the information.
However, if you have the database optimized as scroungr said above and you have decent RAM on the machine that hosts your site, then you will find out that there is practically no difference between the two methods (with or without a template) and also you get the benefit of being able to alter the template file (the way that things are displayed) without touching the php file.
Nikos
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|