Lampwrights Forum > Linux, Apache, MySQL, PHP > MySQL
Register Community Today's Posts Search

Reply
 
Thread Tools
08-09-2010, 06:13 PM   #1
Jeff
Administrator
 
Jeff's Avatar
 
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
When Indexes Attack

I have been having a problem with one MySQL server lately that is hosting a few databases but one in particular with millions of rows of Vbulletin posts and threads. During some queries it would hang in a "Copying to tmp table" state. This was driving me crazy. I could isolate the query and although it was not the most efficient one it should not have bogged things down this bad. After much searching I came across this guys post who was having the same problem.

I began checking the table designs for the post and thread tables and sure enough there were some non-standard indexes there. There have been a few previous administrators of this database so it is quite possible they modified it in the past. I saw many duplicate indexes and removed the ones that did not come stock with VB. Restarted mysql and rebuilt the tables. The query that would take 500 seconds to complete was now finishing in under 2 seconds.

If you are having this problem and are lost, CHECK YOUR INDEXES!
Jeff is offline   Reply With Quote

12-09-2010, 04:55 AM   #2
kajara23
Guest
 
Posts: n/a
That was a real useful tip and I am sure that there are a lot of people having similar issues with their MySQL server and having a tough time!! Now that there is this simple explanation, I am sure they'll check their Indexes and do the needful to get rid of the problem!!
  Reply With Quote
11-08-2014, 03:56 AM   #3
Obama320
Junior Member
 
Join Date: Nov 2014
Posts: 1
Rep Power: 0
Obama320 is getting browny points
I began checking the table designs for the post and thread tables and sure enough there were some non-standard indexes there. There have been a few previous administrators of this database so it is quite possible they modified it in the past. I saw many duplicate indexes and removed the ones that did not come stock with VB. Restarted mysql and rebuilt the tables. The query that would take 500 seconds to complete was now finishing in under 2 seconds.
Obama320 is offline   Reply With Quote
03-18-2024, 01:56 PM   #4
Shylock
Junior Member
 
Join Date: Mar 2024
Location: Amsterdam
Posts: 1
Rep Power: 0
Shylock is getting browny points
Talking

A tale of MySQL server turmoil and triumphant resolution. Jeff's journey through database despair led to a revelation: the culprit behind sluggish queries was none other than rogue indexes. With a few swift modifications and a reboot, the once tortoise-like queries transformed into lightning-fast operations. Lesson learned: always scrutinize your indexes!
Shylock is offline   Reply With Quote
Reply

Tags

configuring mysql

,

mysql best practices

,

mysql queries

,

other mysql



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



All times are GMT -4. The time now is 03:21 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2024, vBulletin Solutions, Inc.