MySQL - CREATE INDEX
CREATE UNIQUE INDEX IDIndex ON HeadOfState (ID);
CREATE INDEX NameIndex ON HeadOfState (LastName, FirstName);
With CREATE INDEX, it's necesary to provide a name for the index. With ALTER TABLE, MySQL creates an index name automatically if you don't provide one.
Unlike ALTER TABLE, the CREATE INDEX statement can create only a single index per statement. In addition, only ALTER TABLE supports the use of PRIMARY KEY.
Choosing an Indexing Algorithm:
CREATE INDEX id_idx USING BTREE ON lookup(id);
page revision: 2, last edited: 28 Dec 2008 10:09





