eEcho blog

is een halte van de gedachte

How MySQL Uses Indexes

http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html

indexes are used to find rows with specific column values quickly. Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The larger the table, the more this costs. If the table has an index for the columns in question, MySQL can quickly determine the position to seek to in the middle of the data file without having to look at all the data. If a table has 1,000 rows, this is at least 100 times faster than reading sequentially. If you need to access most of the rows, it is faster to read sequentially, because this minimizes disk seeks.

Most MySQL indexes (PRIMARY KEY, UNIQUE, INDEX, and FULLTEXT) are stored in B-trees. Exceptions are that indexes on spatial data types use R-trees, and that MEMORY tables also support hash indexes.

Strings are automatically prefix- and end-space compressed. See Section 12.1.4, “CREATE INDEX Syntax”.

Add A Comment

You must be logged in to post a comment.

Home | info@eecho.info | Voorwaarden | Blog