Hello, David.

On Mon, Mar 8, 2010 at 3:55 PM, David X. Glover
<[email protected]> wrote:
> On 8 Mar 2010, at 10:29, David X. Glover wrote:

[snip]

> mysql> SHOW INDEX FROM Users;
> +-------+------------+----------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+
> | Table | Non_unique | Key_name | Seq_in_index | Column_name  | Collation | 
> Cardinality | Sub_part | Packed | Null | Index_type | Comment |
> +-------+------------+----------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+
> | Users |          1 | Users2   |            1 | Name         | A         |   
>       512 |     NULL | NULL   |      | BTREE      |         |
> | Users |          1 | Users3   |            1 | id           | A         |   
>       512 |     NULL | NULL   | YES  | BTREE      |         |
> | Users |          1 | Users3   |            2 | EmailAddress | A         |   
>       512 |     NULL | NULL   | YES  | BTREE      |         |
> | Users |          1 | Users4   |            1 | EmailAddress | A         |   
>       512 |     NULL | NULL   | YES  | BTREE      |         |
> +-------+------------+----------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+

Create primary key on Users(id). Drop index Users3. As an option make
keys Users2 and Users4 unique.

> mysql> SHOW INDEX FROM CachedGroupMembers;
> +--------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
> | Table              | Non_unique | Key_name | Seq_in_index | Column_name | 
> Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
> +--------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
> | CachedGroupMembers |          0 | PRIMARY  |            1 | id          | A 
>         |       16498 |     NULL | NULL   |      | BTREE      |         |
> +--------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+

Create index on CachedGroupMembers(MemberId, GroupId, Disabled) and
reversed one CachedGroupMembers(GroupId, MemberId, Disabled).

Instructions on dropping indexes and creating new you can find in
mysql's documentation.

-- 
Best regards, Ruslan.
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [email protected]

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to