Current location - Training Enrollment Network - Books and materials - Why does the database use a B-tree index instead of a hash index?
Why does the database use a B-tree index instead of a hash index?
Database index is a sort data structure in database management system, which is helpful to query and update the data in database tables quickly. The implementation of index usually uses B-tree and its variant B+ tree.

In addition to data, the database system also maintains data structures that conform to specific search algorithms. These data structures refer to (point to) data in some way so that advanced search algorithms can be implemented on these data structures. This data structure is an index.

Setting an index for a table comes at a price: it increases the storage space of the database, and it takes more time to insert and modify data (because the index will change accordingly).