|
487down vote
|
Differences
Similarities
| |||
- Uninteresting
- Misleading
- Offensive
- Repetitive
- Other
|
All of these are kinds of indices. primary: must be unique, is an index, is (likely) the physical index, can be only one per table. unique: as it says. You can't have more than one row with a tuple of this value. Note that since a unique key can be over more than one column, this doesn't necessarily mean that each individual column in the index is unique, but that each combination of values across these columns is unique. index: if it's not primary or unique, it doesn't constrain values inserted into the table, but it does allow them to be looked up more efficiently. fulltext: a more specialized form of indexing that allows full text search. Think of it as (essentially) creating an "index" for each "word" in the specified column. | |||||
|
|
I feel like this has been well covered, maybe except for the following:
http://stackoverflow.com/questions/707874/differences-between-index-primary-unique-fulltext-in-mysql |
本文深入解析了数据库中各种索引类型的功能与应用,包括主键、唯一、普通和全文索引,阐述了它们如何提高查询效率及数据约束,特别强调了全文索引的特殊用途。







NOT NULL. MySQL will report inshow columnsthat a non-NULL unique key is a primary key, if there are no other primary keys defined. – Gordon Linoff Sep 6 '14 at 20:44