The Arcive of vBulletin Modifications Site. |
|
Query tracking Details »»
|
|||||||||||||||||||||||||
I currently have 38 queries on my index and 50 on my showthread 0_0, Ive gone through the files (index.php/showthread.php/global.php) and cannot seem to find where they are comming from
I was wondering if there is like a way to track the executed queries as the page is processed so i know exactly what is being run and what I might be able to remove.Board url (http://www.infinite-forums.com) There are plenty of hacks installed, but still shouldnt have that many queries, i dont think so anyway. Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
In config.php, add
$debug = 1; to the bottom. Then add &explain=1 to the end of any URL you want to check. |
|
#3
|
|||
|
|||
|
Just remember when debug is on it poses a security risk, so dont leave it on after you are done checking the pages.
|
|
#4
|
|||
|
|||
|
Cool trick. I've been struggling with a very slow index for a while, and now i know why:
Code:
Query: SELECT count(*) AS posts FROM post WHERE dateline > '1060567366' Time before: 1.0531469583511 Time after: 18.15744304657 |
|
#5
|
|||
|
|||
|
That query is from a installed hack, number of posts scence last visit I belive. I would recomend removing it or adding a index to the post table to speed it up.
BTW the query that gets total posts reads as: [sql]SELECT COUNT(*) AS posts FROM post[/sql] |
|
#6
|
|||
|
|||
|
I'd rather not remove it, but how do I add an index to the post table?
|
|
#7
|
|||
|
|||
|
run this query:
[sql]ALTER TABLE post ADD INDEX(dateline) ;[/sql] |
|
#8
|
|||
|
|||
|
Thanks brad, I'll try that
![]() edit: awesome, it now loads in under a second. Thanks man! |
|
#9
|
|||
|
|||
|
No problem, Just make sure that index isent taking up to much space, if it is its time to remove the hack.
|
![]() |
|
|