vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Incorrect key file for table mysql errors (https://vborg.vbsupport.ru/showthread.php?t=281610)

NeverBored 04-16-2012 04:45 AM

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

kh99 04-17-2012 01:00 AM

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.

NeverBored 04-20-2012 05:38 AM

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"

kh99 04-20-2012 09:05 AM

Quote:

Originally Posted by NeverBored (Post 2321805)
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.


All times are GMT. The time now is 05:52 AM.

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.01073 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete