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: 1230458972|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License