B-tree versus R-tree indexes for different searches in MySql
(written by Lawrence Krubner, however indented passages are often quotes)
I didn’t realize that b-tree and r-tree indexes were optimized for different kinds of comparisons:
SourceMatch 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:
For a hash index, a hash function is applied to each column value. The resulting hash values are stored in the index and used to perform lookups. (A hash function implements an algorithm that is likely to produce distinct hash values for distinct input values. The advantage of using hash values is that they can be compared more efficiently than the original values.) Hash indexes are very fast for exact-match comparisons performed with the = or <=> operators. But they are poor for comparisons that look for a range of values, as in these expressions:
id < 30
weight BETWEEN 100 AND 150
B-tree indexes can be used effectively for comparisons involving exact or range-based comparisons that use the <, <=, =, >=, >, <>, !=, and BETWEEN operators. B-tree indexes can also be used for LIKE pattern matches if the pattern begins with a literal string rather than a wildcard character.
May 17, 2012 2:06 am
From free cell phone ringtones on MySql Workbench is a total waste of time
"I like it so much, http://dailybooth.com/freecellphoneringto free cell phone ringtones, jsneke,..."