[rt-devel] Slow Queries part3, Groups

Matthew Watson mwatson at netspace.net.au
Thu Oct 9 01:29:55 EDT 2003


See my other email (looks like we are on the same track).

> When I run the aforementioned query against my database (20k tickets,
> 10,000 users), it takes about a second.  That's not great, but when
> the cache kicks in, it drops down to half a second.  That's still not
> great.

yeh, my real problem is I have almost 700,000 tickets and 150,000 users :)
so that 1 second blows out a bit :)

> Do you know what is triggering the query?

Yep, its when you click "reply" on a ticket, its trying to find
people who have the right to own the ticket (so it also happens when
you click on "People"

> I suspect the real problem here is MySQL's optimizer is falling down.
> Which means we may have to take an alternate track.  Anyone want to
> try MySQL 4.1?  Or (Jesse?) maybe split the OR's up into a few faster
> queries?  Another thought is to replace some of the text strings with
> lookup numbers.. but that'll slow other things down.

Yep, there are a few places where mysql will refuse to use indexes,
I'd say probably in this case, its deciding that the index just
doesn't cut the rows down enough and a sequential search will be faster.

I think probably a couple of faster queries will be better, unless
a mysql guru can optimise the current one?

> Ok.  Enough time with this for tonight.

Hehe, thanks for you efforts, its much appreciated.

Matt.








More information about the Rt-devel mailing list