The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
50 queries and counting, please help!
Ok, I'm working on localhost here and Im trying to reduce queries... Ive installed xenons forum home optimizing hack.. now ive come to the showthread and there are far to many queries and I must reduce them... can anyone hlep me out?
Lesanes awards hack is causing the most damage and was wondering if anyone can help me fix that without getting rid of the awards hack? see next post for query report.... |
#2
|
||||
|
||||
Fixed see new report below
|
#3
|
||||
|
||||
Add these to your showthread.php
$templatesused=""; (you may have to add it to both showthread and postbit sections) ,unregged,vbcode_smiliebit,vbcode_smilies,showthre ad_replybox,yesterday,awards That's 6 queries down. To go down more, you will have to uninstall the Awards hack, which is creating a loop, and giving you 1 query per post per thread. |
#4
|
||||
|
||||
Quote:
|
#5
|
||||
|
||||
Fixed, Updated Post Below
|
#6
|
||||
|
||||
Add "today" to templatesused too.
Sorry, you would have to recode the Awards hack so that it doesn't loop like that. I would use an alternative - just use custom profile fields for awards - they use up no queries, are easy to set up, and easy to modify and customize. |
#7
|
||||
|
||||
Quote:
|
#8
|
||||
|
||||
Make new custom profile fields, make them not editable by user, not viewable by member in profile.
Using your mouse, hover over the edit link, and remember the profield id of each of them. Then, go to Admin CP, User, and to the user you want to give award to, and put in the image HTML: <img src="http://www.yoursite.com/images/awards.gif"> in the custom profield field text input. Then in postbit template, add $post[field26] anywhere you want the image to show up. For people without awards it won't show up. In getinfo template, add $userinfo[field26] instead. Change 26 to the profile id you are using. See? No hacking needed. Best of all, no additional queries at all. |
#9
|
||||
|
||||
Thanks! will do that
|
#10
|
||||
|
||||
Ok now that I did that Im down to 23 queries which is perfect for me but one last time... is there anything else that could be brought down?
Query: SELECT template FROM template WHERE title='options' Time before: 0.032304048538208 Time after: 0.033077955245972 -------------------------------------------------------------------------------- Query: SELECT sessionhash,userid,host,useragent,styleid FROM session WHERE lastactivity>1058421019 AND sessionhash='8840ab49cd89e1b94c671f9b9c48af33' AND (host='127.0.0.1' OR (althash='' AND althash<>'')) AND useragent='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;' Time before: 0.039862990379333 Time after: 0.040616989135742 -------------------------------------------------------------------------------- Query: SELECT user.*,userfield.* FROM user LEFT JOIN userfield ON userfield.userid=user.userid WHERE user.userid='1' Time before: 0.040820002555847 Time after: 0.041581034660339 -------------------------------------------------------------------------------- Query: SELECT * FROM thread WHERE threadid=5 Time before: 0.042281985282898 Time after: 0.042878985404968 -------------------------------------------------------------------------------- Query: SELECT forum.forumid,styleid,styleoverride FROM forum,thread WHERE forum.forumid=thread.forumid AND threadid='5' Time before: 0.043076038360596 Time after: 0.043728947639465 -------------------------------------------------------------------------------- Query: SELECT templatesetid,replacementsetid,userselect FROM style WHERE styleid='1' Time before: 0.043871998786926 Time after: 0.044232964515686 -------------------------------------------------------------------------------- Query: SELECT template FROM template WHERE title='unregged' AND (templatesetid=-1 OR templatesetid=1) ORDER BY templatesetid DESC LIMIT 1 Time before: 0.044376015663147 Time after: 0.044971942901611 -------------------------------------------------------------------------------- Query: SELECT template,title FROM template WHERE (title IN ('showthread_searchthread','showthread_ratingdispl ay','postbit_search','postbit_buddy','postbit_igno re','postbit_useremail','icq','aim','yahoo','postb it_homepage','postbit_profile','postbit_ip_show',' postbit_ip_hidden','postbit','postbit_sendpm','pos tbit_avatar','postbit_offline','postbit_online','p ostbit_editedby','postbit_signature','postbit_atta chment','postbit_attachmentimage','showthread_admi noptions','showthread_threadrate','showthread_poll results_voted','showthread_pollresults_closed','sh owthread_pollresults_cantvote','showthread_firstun read','showthread_nextnewestthread','showthread_ne xtoldestthread','forumrules','showthread','unregge d','vbcode_smiliebit','vbcode_smilies','showthread _replybox','yesterday','today','gobutton','timezon e','username_loggedout','username_loggedin','phpin clude','headinclude','header','footer','forumjumpb it','forumjump','nav_linkoff','nav_linkon','navbar ','nav_joiner','pagenav','pagenav_curpage','pagena v_firstlink','pagenav_lastlink','pagenav_nextlink' ,'pagenav_pagelink','pagenav_prevlink') AND (templatesetid=-1 OR templatesetid=1)) ORDER BY templatesetid Time before: 0.045385956764221 Time after: 0.054196000099182 -------------------------------------------------------------------------------- Query: SELECT * FROM usergroup WHERE usergroupid=6 Time before: 0.057448029518127 Time after: 0.058225989341736 -------------------------------------------------------------------------------- Query: SELECT * FROM forum WHERE forumid='2' Time before: 0.05901300907135 Time after: 0.059674024581909 -------------------------------------------------------------------------------- Query: SELECT *,INSTR(',2,1,-1,', CONCAT(',', forumid, ',') ) AS ordercontrol FROM forumpermission WHERE usergroupid=6 AND (forumid='2' OR forumid='1' OR forumid='-1') ORDER BY ordercontrol LIMIT 1 Time before: 0.059928059577942 Time after: 0.060505986213684 -------------------------------------------------------------------------------- Query: SELECT title, smilietext, smiliepath FROM smilie Time before: 0.060677051544189 Time after: 0.061126947402954 -------------------------------------------------------------------------------- Warning: Cannot add header information - headers already sent by (output started at c:\phpdev\www\public\forum\global.php:155) in c:\phpdev\www\public\forum\admin\functions.php on line 1723 Query: SELECT * FROM forum WHERE forumid='1' Time before: 0.067188024520874 Time after: 0.067926049232483 -------------------------------------------------------------------------------- Query: SELECT forumid,parentid,displayorder,title FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder,forumid Time before: 0.068737983703613 Time after: 0.069466948509216 -------------------------------------------------------------------------------- Query: SELECT forumid,canview FROM forumpermission WHERE usergroupid='6' Time before: 0.069800972938538 Time after: 0.070139050483704 -------------------------------------------------------------------------------- Query: SELECT COUNT(*) AS posts FROM post WHERE post.threadid='5' AND post.visible=1 Time before: 0.0713210105896 Time after: 0.07197105884552 -------------------------------------------------------------------------------- Query: SELECT post.postid FROM post WHERE post.threadid='5' AND post.visible=1 ORDER BY dateline LIMIT 0,40 Time before: 0.072126984596252 Time after: 0.072932004928589 -------------------------------------------------------------------------------- Query: SELECT post.*,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,icon.title as icontitle,icon.iconpath, attachment.attachmentid,attachment.filename,attach ment.visible AS attachmentvisible,attachment.counter ,avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline FROM post LEFT JOIN icon ON icon.iconid=post.iconid LEFT JOIN user ON user.userid=post.userid LEFT JOIN userfield ON userfield.userid=user.userid LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid WHERE post.postid IN (0,6,7,8,9,10,11,12,14,15,17,18,19,20,21,22,23,24, 25,26,27,28,29,30,31) ORDER BY dateline Time before: 0.073382019996643 Time after: 0.083976984024048 -------------------------------------------------------------------------------- Query: SELECT smilietext,smiliepath FROM smilie Time before: 0.086119055747986 Time after: 0.086783051490784 -------------------------------------------------------------------------------- Query: SELECT bbcodetag,bbcodereplacement,twoparams FROM bbcode Time before: 0.10428297519684 Time after: 0.1049929857254 -------------------------------------------------------------------------------- Query: SELECT usergroupid FROM user WHERE userid=1 Time before: 0.20861601829529 Time after: 0.20922195911407 -------------------------------------------------------------------------------- Query: SELECT findword, replaceword, replacementsetid FROM replacement WHERE replacementsetid IN(-1, '1') ORDER BY replacementsetid, replacementid DESC Time before: 0.22727394104004 Time after: 0.22868096828461 -------------------------------------------------------------------------------- Page generated in 0.21704995632172 seconds with 22 queries, spending 0.03301465511322 doing MySQL queries and 0.1840353012085 doing PHP things. Query: UPDATE session SET lastactivity=1058421919,location='/public/forum/showthread.php?s=&threadid=5&showqueries=1' WHERE sessionhash='8840ab49cd89e1b94c671f9b9c48af33' Time before: 0.26303398609161 Time after: 0.26349699497223 -------------------------------------------------------------------------------- Query: UPDATE user SET lastactivity=1058421919,inforum='2' WHERE userid='1' Time before: 0.26358199119568 Time after: 0.26394701004028 -------------------------------------------------------------------------------- Query: UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='5' Time before: 0.26403105258942 Time after: 0.26466202735901 -------------------------------------------------------------------------------- Thanks! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|