Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an index?

What is an index in MySQL ????

like image 376
webnat0 Avatar asked Apr 08 '10 12:04

webnat0


People also ask

What index means?

An index is a group or basket of securities, derivatives, or other financial instruments that represents and measures the performance of a specific market, asset class, market sector, or investment strategy.

What is an index example?

The definition of an index is a guide, list or sign, or a number used to measure change. An example of an index is a list of employee names, addresses and phone numbers. An example of an index is a stock market index which is based on a standard set at a particular time. noun.

What is index in a book?

An index is essentially a roadmap to the book, listing names, places, and things in alphabetical order and giving the page numbers associated with each topic. For nonfiction books, packed with valuable information, a well-made index can help quickly direct the reader to the information they're trying to find.

What is an index and what is it used for?

An index is a copy of selected columns of data, from a table, that is designed to enable very efficient search. An index normally includes a "key" or direct link to the original row of data from which it was copied, to allow the complete row to be retrieved efficiently.


1 Answers

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.

like image 133
Robert Avatar answered Sep 21 '22 00:09

Robert