Skip to main content

Joel Liu's Library tagged Btree   View Popular, Search in Google

Jun
29
2009

  • Match index types to the type of comparisons you perform. When you create an index, most storage engines choose the index implementation they Match index types to the type of comparisons you perform. When you create an index, most storage engines choose the index implementation they will use. For example, InnoDB always uses B-tree indexes. MySQL also uses B-tree indexes, except that it uses R-tree indexes for spatial data types. However, the MEMORY storage engine supports hash indexes and B-tree indexes, and allows you to select which one you want. To choose an index type, consider what kind of comparison operations you plan to perform on the indexed column:
  • If you use a MEMORY table only for exact-value lookups, a hash index is a  good choice. This is the default index type for MEMORY tables, so you need  do nothing special. If you need to perform range-based comparisons with a MEMORY  table, you should use a B-tree index instead. To specify this type of index,  add USING BTREE to your index definition. For example:

1 - 2 of 2
Showing 20 items per page

Diigo is about better ways to research, share and collaborate on information. Learn more »

Join Diigo
Move to top