vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Code Optimisation - Anyone got anything that can optimise your vB files? (https://vborg.vbsupport.ru/showthread.php?t=45293)

Erwin 11-02-2002 07:54 PM

Yes. Replace that with the code posted.

Chris M 11-02-2002 08:57 PM

Its good:)

That and a few other modifications have reduced the forumhome to just 29 Queries!:)

Satan

N9ne 11-02-2002 09:34 PM

I have another question for you php and mysql experts!

Lets say there is a line like this:

eval("\$closeopenthread = \"".gettemplate("newthread_closeopen")."\";");

That line is in my showthread.php file. It has the eval thing, does that mean it's adding a query? If so, how do I change it so it doesn't?

N9ne 11-02-2002 09:46 PM

I did this explain thing and what on earth does all the stuff mean :eek:

Query: SELECT template FROM template WHERE title='colforumtablefooter' AND (templatesetid=-1 OR templatesetid=1) ORDER BY templatesetid DESC LIMIT 1
Time before: 0.51396095752716
Time after: 0.51483500003815

table type possible_keys key key_len ref rows Extra
template range title title 32 2 where used; Using filesort


Like that, I just don't know, I mean it's the template table, but I don't understand what to do?

Ok this looks bad:

Query: UPDATE user SET lastactivity=1036276130 WHERE userid=1 AND lastactivity<1036276130
Time before: 0.19920098781586
Time after: 0.2000550031662

--------------------------------------------------------------------------------

Query: UPDATE user SET lastactivity=1036279082 WHERE userid=1 AND lastactivity<1036279082
Time before: 0.20031905174255
Time after: 0.200718998909

--------------------------------------------------------------------------------

Query: UPDATE user SET lastactivity=1036278622 WHERE userid=1 AND lastactivity<1036278622
Time before: 0.20096302032471
Time after: 0.20142102241516

--------------------------------------------------------------------------------

Query: UPDATE user SET lastactivity=1036278025 WHERE userid=1 AND lastactivity<1036278025
Time before: 0.20167303085327
Time after: 0.20206105709076

--------------------------------------------------------------------------------

Query: UPDATE user SET lastactivity=1036277677 WHERE userid=1 AND lastactivity<1036277677
Time before: 0.20230603218079
Time after: 0.20269000530243

--------------------------------------------------------------------------------

Query: UPDATE user SET lastactivity=1036277096 WHERE userid=1 AND lastactivity<1036277096
Time before: 0.20292901992798
Time after: 0.20330798625946

--------------------------------------------------------------------------------

Query: UPDATE user SET lastactivity=1036276868 WHERE userid=1 AND lastactivity<1036276868
Time before: 0.20354700088501
Time after: 0.20392203330994

--------------------------------------------------------------------------------

Query: DELETE FROM session WHERE lastactivity<1036280063
Time before: 0.2041449546814
Time after: 0.20440900325775

--------------------------------------------------------------------------------

Query: DELETE FROM search WHERE dateline<1035675763
Time before: 0.20457899570465
Time after: 0.2589670419693



Those are the last few queries in showthread...

NTLDR 11-02-2002 09:56 PM

I perfer using showqueries=1

I'm not sure as to what the tables that are produced mean, but you can see each query that is run, and the time each one is taking.

As for the eval bit, if the template name is not in $templatesused before global.php is required then one extra query is added, otherwise no extra query for it.

N9ne 11-02-2002 10:49 PM

Oh right so if there's an eval code line, I just get the template name from it and put it in templatesused and that's the query gone?

Scott MacVicar 11-02-2002 10:51 PM

you'll find that all of them in the eval statement is in the templatesused.

Just ones that aren't called often or rarely are left out as it would be a waste of time to fetch those pages with the rest.

Erwin 11-03-2002 04:43 AM

@ N9NE - let me guess, you have the "total user time online" hack by gforce2k installed. :) Those are extra queries to reset the time for when you are online I think.

N9ne 11-03-2002 05:58 PM

So the Total Time Online hack is adding about 7 queries to showthread? :eek:

NTLDR 11-03-2002 06:12 PM

Only if you have applied it wrong, I've checked mine and I don't have 7 queries for it.


All times are GMT. The time now is 07:12 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01122 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete