Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alter table yourTableName add index yourIndexName(col1, col2);
- mysql> select * from table1;
- +---------+------+------+-------------+
- | autonum | ID | name | metavalue |
- +---------+------+------+-------------+
- | 1 | 1 | Rose | Drinker |
- | 2 | 1 | Rose | Nice Person |
- | 3 | 1 | Rose | Runner |
- | 4 | 2 | Gary | Player |
- | 5 | 2 | Gary | Funny |
- | 6 | 2 | Gary | NULL |
- | 7 | 2 | Gary | Smelly |
- +---------+------+------+-------------+
- 7 rows in set (0.01 sec)
- mysql> alter table table1 add index autoNumID(autonum, ID);
- Query OK, 0 rows affected (0.02 sec)
- Records: 0 Duplicates: 0 Warnings: 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement