Solved

Hash Index

Posted on 2008-10-23
4
1,106 Views
Last Modified: 2012-08-13
I am trying to create a Hash Index on one of the columns of my table, but as I click 'Apply Changes', it gets automatically converted to BTREE index. Why?
I also want to know which index has good performance, a HASH index or a BTREE index, for an InnoDB table.
0
Comment
Question by:rpkhare
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 26

Expert Comment

by:Umesh
ID: 22793926
Which engine are you using for that table?  is it InnoDB/MyISAM ?

Some storage engines allow you to specify an index type when creating an index. The allowable index type values supported by different storage engines are shown in the following table. Where multiple index types are listed, the first one is the default when no index type specifier is given.

Storage                               Engine Allowable Index Types
MyISAM                                     BTREE, RTREE  
InnoDB                                      BTREE
MEMORY/HEAP                        HASH, BTREE  
NDB                                      HASH, BTREE (see note in text)



For your second query...

http://dev.mysql.com/doc/refman/5.1/en/innodb-adaptive-hash.html
0
 
LVL 8

Author Comment

by:rpkhare
ID: 22798332
InnoDB.
0
 
LVL 26

Accepted Solution

by:
Umesh earned 125 total points
ID: 22798532
InnoDB's default index type is "BTREE"..

InnoDB has a mechanism that monitors index searches made to the indexes defined for a table. If InnoDB notices that queries could benefit from building a hash index, it does so automatically.

Note that the hash index is always built based on an existing B-tree index on the table. InnoDB can build a hash index on a prefix of any length of the key defined for the B-tree, depending on the pattern of searches that InnoDB observes for the B-tree index
0
 
LVL 8

Author Closing Comment

by:rpkhare
ID: 31510076
Thanks
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword This article was written many years ago, in the days when PHP supported the MySQL extension (http://php.net/manual/en/function.mysql-connect.php).  Today (http://php.net/manual/en/migration70.removed-exts-sapis.php) you would not use MySQL…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question