vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   92 queries in forum index (https://vborg.vbsupport.ru/showthread.php?t=43404)

hidjra 09-10-2002 07:27 PM

92 queries in forum index
 
Hi,

I just found out that my index page has more dan 92 queries, my host is starting to complain :nervous: How can i reduce the amount of queries??

I have a lot of hacks installed :(

hidjra

g-force2k2 09-10-2002 10:57 PM

what hacks do you have installed on the forumhome? if you look at the thread in help me finish forum TECK posted something worth taking three queries and making it one ;) regards...

g-force2k2

Erwin 09-11-2002 12:36 AM

93 would kill any server. Keep in mind a stock vB has 17 queries on the index page (I think). Take out the hacks that uses loops eg. ones that does queries on each forum you have.

hidjra 09-11-2002 12:49 AM

Quote:

Originally posted by g-force2k2
what hacks do you have installed on the forumhome? if you look at the thread in help me finish forum TECK posted something worth taking three queries and making it one ;) regards...

g-force2k2

i managed to reduce the amount of queries from 92 to 37 by;

Removing;
- https://vborg.vbsupport.ru/showthrea...=lasttitlehack
- https://vborg.vbsupport.ru/showthrea...forumthreadvew

And by using;
- https://vborg.vbsupport.ru/showthrea...threadid=43305

Thanx for the tip. But i still have a long way to go, 37 queries is still a lot!

hidjra

hidjra 09-11-2002 12:50 AM

Quote:

Originally posted by Erwin
93 would kill any server. Keep in mind a stock vB has 17 queries on the index page (I think). Take out the hacks that uses loops eg. ones that does queries on each forum you have.
That would be a good a reason for my host to go crazy :cheeky:

hidjra

Erwin 09-11-2002 01:42 AM

37 queries is a far cry from 93 - that's a lot better. :)

What's the URL to your forums?

Try to get it to below 30 - remove queries and hacks that are unnecessary.

TECK 09-11-2002 02:00 AM

my forums have 14queries on forumhome...
what's the url? and hacks exacly did you installed?

hidjra 09-11-2002 09:41 AM

Quote:

Originally posted by Erwin
37 queries is a far cry from 93 - that's a lot better. :)

What's the URL to your forums?

Try to get it to below 30 - remove queries and hacks that are unnecessary.

thanx, still working on it, i have installed a lot of small hack which i can't even remember installing.

This is the url to my forum
http://community.marokko.nl/forums/

http://community.marokko.nl/forums/i...hp?=&explain=1

hidjra

TECK 09-11-2002 09:54 AM

first of all, you are using vb224, in other words you expose yourself (security issues).

second, all those queries (example):
"SELECT template FROM template WHERE title='P_themeheader' "
are just template names that you forgot to cache into $templateused. for each title you forgot, you add a query.

third, you have few hacks that you van spare them... ex member of the day, etc. you have a busy board, so think server wise...

if i would be you i would upgrade asap, to 227 and start hacking slowly again the new board, checking aways the queries.
you could also install in your pc vbulletin so you can do your home work there first.
read this tutorial i made:
https://vborg.vbsupport.ru/showthrea...threadid=39482

let me know if you have any questions...

hidjra 09-11-2002 10:11 AM

[QUOTE]Originally posted by TECK
[B]first of all, you are using vb224, in other words you expose yourself (security issues).

Quote:

second, all those queries (example):
"SELECT template FROM template WHERE title='P_themeheader' "
are just template names that you forgot to cache into $templateused. for each title you forgot, you add a query.

thanx this works, got it down to 33 queries :)

Quote:

if i would be you i would upgrade asap, to 227 and start hacking slowly again the new board, checking aways the queries.
you could also install in your pc vbulletin so you can do your home work there first.
read this tutorial i made:
https://vborg.vbsupport.ru/showthrea...threadid=39482

let me know if you have any questions...

i was already planning to do this, just did'nt have the time, thanx for the advice.

hidjra

Erwin 09-11-2002 07:33 PM

If I can see your ?explain=1 then I can hack into your board. :) 2.2.6 and up have disabled this function because of security issues. As TECK said, remember to upgrade. And well done - 33 is very reasonable indeed. :)

hidjra 09-12-2002 12:37 AM

thanx for all the help guys :squareeyed: . Now i seem to have the same problem with my showthread file, there are 59 queries, and for some reason these 2 queries are repeated for about 20 times, there must be a loop somewhere, i just can't figure out where;

- Query: SELECT usergroupid FROM user WHERE userid=4518
- Query: SELECT moderatorid FROM moderator WHERE userid='4518' LIMIT 1

can someone please help me :ermm:

hidjra

g-force2k2 09-12-2002 01:53 AM

PHP Code:

$DB_site->query_first("
  SELECT user.usergroupid AS usergroupid, moderator.moderatorid AS moderatorid
  FROM user
  LEFT JOIN moderator ON moderator.userid = user.userid
  WHERE user.userid='
$bbuserinfo[userid]'"); 

I haven't tested this but it should work :) regards...

g-force2k2

hidjra 09-12-2002 07:32 AM

Quote:

Originally posted by g-force2k2
PHP Code:

$DB_site->query_first("
  SELECT user.usergroupid AS usergroupid, moderator.moderatorid AS moderatorid
  FROM user
  LEFT JOIN moderator ON moderator.userid = user.userid
  WHERE user.userid='
$bbuserinfo[userid]'"); 

I haven't tested this but it should work :) regards...

g-force2k2

thnx g-force, but where should i put this? :surprised:

hidjra

g-force2k2 09-12-2002 05:25 PM

just put it in place of the other two queries where ever they appear together... regards...

g-force2k2


All times are GMT. The time now is 02:39 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.01466 seconds
  • Memory Usage 1,760KB
  • 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
  • (2)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete