Difference between revisions of "MySQL"

Jump to navigation Jump to search
46 bytes added ,  15:21, 20 June 2012
m
→‎Keys / Indexes: Minor update
(→‎SHOW etc: Renamed to " Maintenance" and added "Corruption")
m (→‎Keys / Indexes: Minor update)
Line 141: Line 141:
=== Keys / Indexes ===
=== Keys / Indexes ===
There are three different types of indexing available for a table, all of which can be made against one or more columns in your table
There are three different types of indexing available for a table, all of which can be made against one or more columns in your table
* '''Primary''' - compulsory, often on an <code>AUTO_INCREMENT</code> id  
* '''Primary''' - compulsory, often on an <code>AUTO_INCREMENT</code> id.  Must be unique for each row.
* '''Unique''' - optional, useful to enforce uniqueness in a table and stop duplicate entries.
* '''Unique''' - optional, useful to enforce uniqueness in a table across columns not included in Primary Key
* '''FullText''' - optional, used to create a full text index, which you can later do fuzzy searches against.
* '''FullText''' - optional, used to create a full text index, which you can later do fuzzy searches against.
All keys have a name, if you don't specify one at creation, the name of the first column is used.
All keys have a name, if you don't specify one at creation, the name of the first column is used.


Navigation menu