On Thu, Oct 4, 2018 at 12:47 AM Lukasz Szybalski <[email protected]> wrote: > Thanks, > one more. This one times out with gateway error and it takes about 9gb of ram > if I run it on workbench > > SELECT > author, count(distinct(ticket)) AS 'Count of Tickets' > FROM ticket_change > WHERE time > UNIX_TIMESTAMP(NOW() - INTERVAL 30 DAY)*1000000 > GROUP BY author > ORDER BY count(distinct(ticket)) ASC ,author
It is difficult to solve, but field 'comment' is always created when changing a ticket. Adding "field = 'comment'" to clauses might reduce the resources. SELECT author, COUNT(DISTINCT ticket) AS 'Count of Tickets' FROM ticket_change WHERE field = 'comment' AND time > UNIX_TIMESTAMP(NOW() - INTERVAL 30 DAY) * 1000000 GROUP BY author ORDER BY 2, 1 -- Jun Omae <[email protected]> (大前 潤) -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
