Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
835 views
in Technique[技术] by (71.8m points)

mysql - What is an index?

What is an index in MySQL ????

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...