Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. alter table yourTableName add index yourIndexName(col1, col2);
  2.  
  3. mysql> select * from table1;
  4.  
  5. +---------+------+------+-------------+
  6. | autonum | ID | name | metavalue |
  7. +---------+------+------+-------------+
  8. | 1 | 1 | Rose | Drinker |
  9. | 2 | 1 | Rose | Nice Person |
  10. | 3 | 1 | Rose | Runner |
  11. | 4 | 2 | Gary | Player |
  12. | 5 | 2 | Gary | Funny |
  13. | 6 | 2 | Gary | NULL |
  14. | 7 | 2 | Gary | Smelly |
  15. +---------+------+------+-------------+
  16. 7 rows in set (0.01 sec)
  17.  
  18. mysql> alter table table1 add index autoNumID(autonum, ID);
  19. Query OK, 0 rows affected (0.02 sec)
  20. Records: 0 Duplicates: 0 Warnings: 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement