Hello, I am new to mysql and bulding queries, I have been making this query to retrieve some specific results and it works fine. The problem is that sometimes it takes a bit longer than usual to return the results. I have asked some simular but simpler question about such query before but the suggestions didn't make any difference. I'd appreciate your comments.
Hi, its hard to tune a query without having the info on the data and structure of the tables. How many rows in the tables?? Which tables are optional? you should not use LEFT/RIGHT OUTER JOIN if not needed.( That, i can only tell with the tables and data struture) Try this, might not make much of a difference, its a start.
Impossible to tell if the query is efficient without knowing the full structure of the database. Are the any indexes defined on any of these tables ? If not then read up on that as it can make quite a difference in performance. If so have you checked with EXPLAIN if they are actually being used ?