Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 12-30-2009, 02:47 PM
DragonBlade's Avatar
DragonBlade DragonBlade is offline
 
Join Date: May 2006
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default MySQL taking hella long with a simple query.

Lately, after upgrading my server and tweaking it, MySQL's been choking on something I would think is a very simple, straight-forward query. The query comes from includes/functions_newpost.php on line 382:

PHP Code:
$getfirstpost $vbulletin->db->query_first("SELECT postid FROM " TABLE_PREFIX "post WHERE threadid=$threadinfo[threadid] ORDER BY dateline LIMIT 1"); 
For some reason, quite often (but not always) this query is taking a very long time. My users report (with varying accuracy) that this tends to happen in larger threads more often (though I personally think that is only because the larger threads are visited more, so of course people would notice it there more).

My MyISAM Index space is just over 500 MB, and I've got my key_buffer_size set to 640M, so I'm not convinced the answer is "throw more memory at it." My post table itself has 4 million entries and is 1.3GB in size, though, if anyone wants to argue differently. XP

Anyways, has anyone else experienced this? Does anyone know if I should be looking at a particular value? I'm not sure if it's different by default or if the previous Admins set it this way, but I don't have a threadid index by itself--only an index of threadid AND userid. (There is a separate index for just userid.) Could it possibly solve my problem if I put an index on threadid?



Thanks everyone, sorry for being such a newb.

--------------- Added [DATE]1262205545[/DATE] at [TIME]1262205545[/TIME] ---------------

Well, it seems my users were right--it -does- seem to be in the larger threads only. XP

It also seems to happen only when using Quick Replies.

And I -think- (though am not sure) that it only happens to those who are "Mods" of the forum in which they are posting.



If anyone could shed some light for me, I'd be grateful.

--------------- Added [DATE]1262231966[/DATE] at [TIME]1262231966[/TIME] ---------------

A little more light to shed on the situation, if anyone can help...

This seems to also be occurring with "Quick" Edits... What with the Quick Reply and the Quick Edits, could something be screwed up with my AJAX that's causing my MySQL to get ornery? It's vBulletin 3.8.4, Patch Level 2. I do have several plugins, but the queries in my slow logs are from the vBulletin scripts, not any of the plugins. One plugin we use is AJAX-heavy AND out-of-date; it's called iSpy and let's you view new posts on the forum as they are made (we allow only our Donators access to it). I don't know the guts of it, so I don't know if it calls includes like functions_newpost.php, or if it has a very similar query to those in functions_newpost.php and other includes, or if it has nothing to do with the problem at all.

I'd like to get some advice from you guys before I decide to shut it off for a few days, because it's something we like to make sure our donators have, to show our appreciation. (Of course, I'm certain they'd much rather have a stable forum, heh.)
Reply With Quote
Reply

Thread Tools
Display Modes

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 11:09 PM.


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.03492 seconds
  • Memory Usage 2,154KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)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_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