Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-16-2012, 04:45 AM
NeverBored NeverBored is offline
 
Join Date: Feb 2008
Location: CA
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Incorrect key file for table mysql errors

Suddenly I'm getting a bunch of these errors every day for the past week. It's not constant, but seemingly random I'll get 1+ error emails at a time. From the looks of it I'm not sure that it's a VB problem directly, but I'm really just hoping someone can help me out. I don't understand where the table it quotes is or how to repair it... The query listed is a plugin that grabs a list of 5 threads, is there something wrong with it? It works, and I've been using it for like a year.

Invalid SQL:
SELECT * FROM thread WHERE ytvideo AND forumid IN (13) AND open=1 ORDER BY RAND() DESC LIMIT 5;

Incorrect key file for table '/var/mysqltmp/#sql_45a7_6.MYI'; try to repair it
Reply With Quote
  #2  
Old 04-17-2012, 01:00 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm guessing that's some sort of temporary table created by that query. Do you have a lot of threads in your database? I think ORDER BY RAND isn't very efficient for large tables, and if there's no caching of the random threads then it's going to have to be done every time someone visits the page.
Reply With Quote
  #3  
Old 04-20-2012, 05:38 AM
NeverBored NeverBored is offline
 
Join Date: Feb 2008
Location: CA
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the reply. There is only about 9000 threads currently (don't know if that would be considered a lot). It has good purpose to get random results every page load, but I understand it may not be efficient. From a performance stand point, would it make any difference if I limited it to threads within a small date range rather than picking from all the threads?

Interestingly the error emails seemed to have now changed over the past 24 hours to mostly "Got error -1 from storage engine"
Reply With Quote
  #4  
Old 04-20-2012, 09:05 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NeverBored View Post
Thanks for the reply. There is only about 9000 threads currently (don't know if that would be considered a lot). It has good purpose to get random results every page load, but I understand it may not be efficient. From a performance stand point, would it make any difference if I limited it to threads within a small date range rather than picking from all the threads?
I don't know if that's "a lot" either. You could try adding a date range and see if the errors go away. To be honest my reply was just a guess so I'm not sure the error is related to the ORDER BY.
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 07:16 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.03643 seconds
  • Memory Usage 2,186KB
  • Queries Executed 13 (?)
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_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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