Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Hash Index

Posted on 2008-10-23
4
Medium Priority
?
1,122 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 375 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

722 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