Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Query tracking Details »»
Query tracking
Version: , by InfiniteWebby InfiniteWebby is offline
Developer Last Online: Aug 2007 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-10-2003 Last Update: Never Installs: 0
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-10-2003, 07:59 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In config.php, add

$debug = 1;

to the bottom.

Then add

&explain=1

to the end of any URL you want to check.
Reply With Quote
  #3  
Old 08-10-2003, 09:11 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just remember when debug is on it poses a security risk, so dont leave it on after you are done checking the pages.
Reply With Quote
  #4  
Old 08-11-2003, 01:08 AM
DiscussAnything DiscussAnything is offline
 
Join Date: Jan 2002
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
And 18 seconds is fast, it's sunday night now. During the week it's even slower. Is this the query that gets the total posts? The one that does the threads and users is fast though. Is there anything I can do to speed this up?
Reply With Quote
  #5  
Old 08-11-2003, 01:45 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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]
Reply With Quote
  #6  
Old 08-11-2003, 02:19 AM
DiscussAnything DiscussAnything is offline
 
Join Date: Jan 2002
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd rather not remove it, but how do I add an index to the post table?
Reply With Quote
  #7  
Old 08-11-2003, 09:07 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

run this query:

[sql]ALTER TABLE post ADD INDEX(dateline) ;[/sql]
Reply With Quote
  #8  
Old 08-11-2003, 12:09 PM
DiscussAnything DiscussAnything is offline
 
Join Date: Jan 2002
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks brad, I'll try that



edit: awesome, it now loads in under a second. Thanks man!
Reply With Quote
  #9  
Old 08-11-2003, 12:34 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem, Just make sure that index isent taking up to much space, if it is its time to remove the hack.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:01 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04625 seconds
  • Memory Usage 2,272KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete