First, the index table is much smaller than the tables with data, and therefore it can be read faster. Second, the DBMS most often try to cache the indexes in RAM, which is faster than the hard drive. Third, the indexes do not duplicated lines, so as soon as we found the first value, the search can be stopped.
The clustered index is a tree data structure, where index values are stored with the data relevant to them. The indexes and data are in order. When a new line is added in the table, it is written in the right branch of the tree structure, corresponding to sorting.
Read full article from MySQL (InnoDB) clustered and non-clustered indexes - MySQL
The clustered index is a tree data structure, where index values are stored with the data relevant to them. The indexes and data are in order. When a new line is added in the table, it is written in the right branch of the tree structure, corresponding to sorting.
Read full article from MySQL (InnoDB) clustered and non-clustered indexes - MySQL
No comments:
Post a Comment