MySQL Index Types

The documentation for MySQL index types is hidden in the page on CREATE TABLE Syntax and isn’t as clear as it could be. Here’s an overview. (some of this is pretty obvious but I’m erring on the side of redundancy).

  • KEY and INDEX are synonyms and mean that the colum should be indexed, and do NOT require the column to be unique
  • UNIQUE is unique
  • PRIMARY KEY:
    • is an index
    • implies that all the columns are UNIQUE
    • all columns in the key must be defined as NOT NULL
    • a table can only have one PRIMARY KEY

Let me know if I’m missing anything.

2 Responses to “MySQL Index Types”


  1. 1 jimmyhat

    fulltext?

  2. 2 Thanga

    I think fulltext is missing

Leave a Reply




Close
Powered by ShareThis