I created a report which shows a column of analysts, how many tickets that came in via email that they worked and then another page with a detail on each ticket of how long the ticket waited in the queue. It's great if you're looking at a 1 week period, but more that that causes the database to hang and I have to go to Activity Monitor and kill the process.
Originally I had a view and then the Crystal report had a command that calculated totals from the view. To try to speed it up I've tried using just a query, but It's still slow AND I don't know how to include the calculation.
I've attached the query, with the calculation bit commented out. If I leave the calculation in then the DISTINCT isn't valid and I get even more results, which takes even longer.
If I could get the basic query here (without the commented out part) to run faster, then I could deal with the calculations by adding a subquery or let Crysal calculate it.
Maybe someone with a better understanding of SQL can help with this? Or, maybe I've gone about it completely wrong?
Thanks for any help you can provide!
emails worked new query.sql 851 bytes