On 02/05/2013 03:35 PM, David Good wrote: > We have an issue with our RT 4.0.8 instance that we didn't have with > 3.8.8 that we just finished migrating from. Some of our managers like > to search for tickets where the requestor is a 'VIP' user. They use > fairly straightforward TicketSQL to build saved searches that are then > used for dashboards and RT at a Glance items. This all worked fine in > RT 3.8.8, but when we upgraded to 4.0.8 the queries take so long to run > that it ends up timing out the webserver, making it very difficult for > users using them in RT at a Glance to login. Checking the MySQL slow > query log (or just doing a 'show full processlist' while it's running) > shows that fairly straightforward TicketSQL query gets expanded into > ridiculously complex MySQL queries doing multiple joins on the same > tables for the same columns. Is this a known issue?
Open bug here: http://issues.bestpractical.com/Ticket/Display.html?id=18414 Another RT user wrote a patch which is MySQL-specific, but it's not a clean solution (code-wise) and has some problems which make it not something we can just ship as-is (see the ticket). It's a straightforward query, but also seems a tad ridiculous to be listing so many individual addresses. As a more maintainable solution, and a workaround to the bug, try setting the Organization of every one of those big wigs to "VIP" or "Executive" or similar. Then you can write a much nicer query like this: Status = 'open' and Requestor.Organization = 'VIP' This also means all you need to do when a big wig cashes out or a new one comes in is to adjust their Organization, rather than potentially edit a whole bunch of saved searches. If you're already using Organization, you can use another user field instead (some are searchable by default, others need a couple config tweaks). > Here's an example: > > This TicketSQL: > > Status = 'open' AND > ( > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' OR > Requestor.EmailAddress = '[email protected]' > ) -- Help improve RT by taking our user survey: https://www.surveymonkey.com/s/N23JW9T
