Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What steps should be necessary to optimize a poorly performing query?

I know this is a broad question, but I've inherited several poor performers and need to optimize them badly. I was wondering what are the most common steps involved to optimize. So, what steps do some of you guys take when faced with the same situation?

Related Question:
What generic techniques can be applied to optimize SQL queries?

like image 791
Kilhoffer Avatar asked Sep 14 '08 00:09

Kilhoffer


People also ask

What is optimization query optimization methods?

Query optimization is the overall process of choosing the most efficient means of executing a SQL statement. SQL is a nonprocedural language, so the optimizer is free to merge, reorganize, and process in any order. The database optimizes each SQL statement based on statistics collected about the accessed data.


1 Answers

  1. Look at the execution plan in query analyzer
  2. See what step costs the most
  3. Optimize the step!
  4. Return to step 1 [thx to Vinko]
like image 78
roman m Avatar answered Oct 06 '22 13:10

roman m