Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: May 2002
Posts: 20
Newbie
Newbie
Offline
Joined: May 2002
Posts: 20
Boards are at www.tigerboards.net

My 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

Sponsored Links
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
Offline
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.

Sponsored Links
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

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)