In addition to the above...
Depending on how technical you wish to be, most database systems can tell you how they are actually running the query. Oracle has "explain plan" , for example. If you can get at that information it may show you what you need to fix the query.