Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a server running LAMP which contains a number of zencart sites. We noticed a problem when trying to view orders in one of the sites and it timed-out. Now when I do:

"select * from orders"

The whole thing freezes, so does:

SHOW PROCESSLIST

Now the orders table should have around 42000 orders in it, do it's not THAT large. Can anyone reccommend any good diagnostic techniques to figure out whats going wrong?

share|improve this question
    
by freezes I mean...it does what it would normally do when processing a query that would take some time. But doesn't actually do anything. It's been in "Query is being executed..." for approx 45 minutes. The server setup (ie cpu, ram etc) its more than capable to do this. –  Grant Unwin Apr 4 '11 at 11:54

3 Answers 3

What happens when you do "explain select * from orders" query? and "select count() from orders" ? Explain statement should give you some insight in whats happening with your query (it explains how server will execute it and helps you to diagnose a bottleneck) and count() will let you know, if 42 000 you mentioned is still in that range.

share|improve this answer

I thnk there is a problem with your index. Can you try

OPTIMIZE TABLE `orders`
CHECK TABLE `orders`
REPAIR TABLE `orders`

Also you can try dumping and recreate.

share|improve this answer

Managed to resolve this. Using MySQL Query browser it allowed me to see the current running threads. There were a few intensive MyIsam quaries that were locking the table for some reason. I killed these and the backlog cleared in seconds. Back to normal. Woop!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.