Solved

Hash Index

Posted on 2008-10-23
4
1,049 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
  • 2
  • 2
4 Comments
 
LVL 26

Expert Comment

by:ushastry
Comment Utility
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
Comment Utility
InnoDB.
0
 
LVL 26

Accepted Solution

by:
ushastry earned 125 total points
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now