Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 16 Apr 2012, 06:45
NeverBored NeverBored is offline
 
Join Date: Feb 2008
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 17 Apr 2012, 03:00
kh99's Avatar
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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.
__________________
Please don't PM me - post your questions in the appropriate forum.
Please don't PM me to ask me to read your thread.
Reply With Quote
  #3  
Old 20 Apr 2012, 07:38
NeverBored NeverBored is offline
 
Join Date: Feb 2008
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 20 Apr 2012, 11:05
kh99's Avatar
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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.
__________________
Please don't PM me - post your questions in the appropriate forum.
Please don't PM me to ask me to read your thread.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 01:22.

Layout Options | Width: Wide Color: