[rt-devel] Slow Queries part3, Groups

Matthew Watson mwatson at netspace.net.au
Thu Oct 9 20:56:26 EDT 2003


> Matthew, could you test next query on your DB and compare time:
> SELECT STRAIGHT_JOIN DISTINCT main.*
>          FROM
>                  ACL ACL_2,
>                  Principals Principals_1,
>                  Groups main
>          WHERE ... ORDER BY main.Name ASC;
>
> This select uses indexes in all joins, but for me it's ~3 times slower
> than native plan with sequential search on Groups table.

This seemed to cut about a minute off the query (from 2.5 to 1.5 minutes),
although its possible my db was very busy.



> If I eliminate Principals_1.id at all and also 'select from' and
> 'ACL_2.PrincipalId = Principals_1.id' change to 'ACL_2.PrincipalId =
> main.id' then I have same results, but query is faster.
>

hrmm, not sure, jesse?

Regards,
Matthew Watson.








More information about the Rt-devel mailing list