Two tips:
- Lose the DISTINCT keyword. For a query like this - depending on the amount of rows returned - it is a performance killer
- Check if you have useful indexes for the predicates in the WHERE clause, and for each JOIN
The fact that a selection of one table takes up to 15 seconds, and that of another table also takes up to 15 seconds, is no guarantee that if those results are joined together that the performance is anywhere close to 30 seconds. On the other hand, eliminating some joins from the query might point to where your indexes are not very useful.
Gert-Jan
No comments:
Post a Comment