[Rt-devel] Slowest query in our setup

Robert Spier rspier at pobox.com
Tue Aug 3 01:33:43 EDT 2004


> For example in this slow query ACL and Groups are restricted by clause:
> (
>     ACL_1.PrincipalId = main.id AND ACL_1.PrincipalType = 'Group'
> ) OR (
>     main.Type = ACL_1.PrincipalType
> )
> 
> This clause can be split in two and optimized with indexies first on
> ACL(PrincipalId, PrincipalType,...) and second on
> ACL(PrincipalType,...). MySQL can use only one index so it doesn't use
> any.

If the index was:

    ACL(PrincipalType, PrincipalId)

it may be able to use it for both.

(Index Prefix Matching)



More information about the Rt-devel mailing list