MySQL index advantages and disadvantages

Advantage:

  1. Similar university library was built bibliographic index, improve data retrieval efficiency, reduce the cost of database IO
  2. By index column to sort the data, cost data sorting, reducing the CPU usage

Disadvantages:

  1. In fact, the index is also a table that holds the primary key and index fields, and points to record a solid table, so the index column is to take up space
  2. Although the index greatly increased query speed, while it will reduce the speed of updating the table, such as table INSERT, UPDATE, and DELETE.
    Because when you update the table, MYSQL not only to save data, but also save about index file is updated each time adding a field index column will adjust because the index information of the key changes brought about by the update
  3. The index is just one factor to improve efficiency, MYSQL if you have a large amount of data tables, we need to take the time to research the best indexing, query optimization, or
Published 217 original articles · won 125 Like · views 10000 +

Guess you like

Origin blog.csdn.net/qq_39885372/article/details/104164659