Turning hours into minutes, and minutes into seconds.
1-Excessive permission of NULL fields (worse in PL/SQL), one of the reasons for item 2 on this list..
 
2-Use of functions in the WHERE clause.
 
3-Lack of conditions in WHERE, or in JOIN (mainly in LEFT JOINS).
 
4-Poor modeling (sometimes a measly status field would save the day).
 
5-Use of subqueries that could be resolved with JOIN (worse in SQL SERVER).
 
6-Appealing to UNION (I'm not demonizing UNION, sometimes it is the solution).
 
7-Solving everything with CURSOR (A vice of the Oracle people), cursors have their uses (PGA, blah, blah, blah), the famous procedural mindset, don't use them simply because you don't want to waste your gray matter, even with BULK, cursors will never be as fast as pure SQL.
 
8-Lack or excess of indexes (This is a task for the developer, but the DBA can solve it).
 
9-Implicit conversions in WHERE or JOIN resulting from poor data modeling.
 
10-Relying on functions (that access other tables) to perform calculations, when you could do it within the body of the Select itself.
Top 10 reasons of slow SQL code (By Marcello Dias)
DNossa história