Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm facing a very slow MySQL database right now. As far as hardware is concerned, everything looks fine, but we still have many queries that are very slow.

We're using proprietary software, so we can't optimize the queries and all performance optimization has to be done on the database end. I'm looking for a few tips from you guys, where to look at, where to keep an eye on and which basic procedures should be followed.

Thanks in advance for any help!

ps.: Blog posts, articles and other links with QUALITY content are also welcome. Please, don't troll the question telling me to Google, because if i wanted, i would Google. I'm looking for quality advice from experienced people, quality links, not just random crap found by search engines.

share|improve this question

migrated from Aug 5 '11 at 10:16

This question came from our site for professional and enthusiast programmers.

If you cannot performance tune the queries, you can look into things like indexing and partitioning

You'll have to look at the queries being executed with a profiler to help you determine which indexes would be most effective.

Partitioning is only relevant if you have extremely large tables.

share|improve this answer

Try running to make sure your configuration is sane.

Even if you can't change the queries, you can always use EXPLAIN on the problem queries to get an idea of how indexes might help. Keep an eye on the slow query log to see which queries to focus on.

share|improve this answer

Use Views rather than select x,y from z where c = 'value'
Use Stored procedures
Find out which database engine is suitable to you.

If you could benchmark queries execution time you can come to result, wat is the problem exactly.

share|improve this answer
None of that is relevant, except last item. – Mitch Wheat Aug 3 '11 at 1:42
@Mitch Wheat : Don't trust me. try to create view and stored procedure and bench mark queries vs views vs stored procedure, you will save time. . . – kracekumar Aug 3 '11 at 1:44

Your Answer


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