TicketQuery: ''format=count'' now re-uses some of the Query code to directly perform the count at the sql level (from #216).
TicketQuery: ''format=count'' now re-uses some of the Query code to directly perform the count at the sql level (from #216).

This is much cheaper but has the disadvantage of by-passing the fine-grained permission checks.

Note however that the same can be said for #216, and there, it's not only the count but also the whole paging logic (use of `LIMIT` and `OFFSET`) that doesn't take the fine-grained permissions into account. So the problem has to be fixed there, if possible.

Note that the only adverse effect will be to show ticket counts higher than the number of tickets actually shown to the user.

pkdevbox/trac,pkdevbox/trac,pkdevbox/trac,pkdevbox/trac