MySQL table, what is INDEX


I know PRIMARY key is to have unique value, what about INDEX? What is the function of a table column with INDEX?

Best Solution

INDEX columns are exactly that. They're indexed to make it faster to look up information using that column. MySQL typically stores Indexes in B-Trees or R-Trees. An appropriate case for the use of an index would be if you're using a where clause on a particular column (or group of columns) regularly.

Indexes are a topic worthy of whole chapters in database books, a good place to start looking for more information might be the mysql reference manual.