What is an index?

后端 未结 7 1843
無奈伤痛
無奈伤痛 2020-12-15 06:42

What is an index in MySQL ????

相关标签:
7条回答
  • 2020-12-15 07:34

    Indexes speed up SELECT queries because indexes are sorted by definition. Additionally a UNIQUE index enforces the constraint that the value of that column (or the combination of values of bound columns) exists only once (same applies to PRIMARY, but PRIMARY can only exist once per table in contrast to a UNIQUE key).

    Indexes are a tradeoff: they tremendously speed up SELECT queries (when used columns have an INDEX) but they make that MySQL table consume more space and cost more time when changing the table via INSERT/UPDATE/DELETE.

    0 讨论(0)
提交回复
热议问题