MySQL Static Hash-index
Is there any way to prespecify the size of a hash index during the initial table creation. If I know that I may eventually have 200 million unique keys an开发者_运维技巧d I don't want to to come to a halt resizing at 100 million can the size be prespecified.
Do any other free databases support presized hash tables?
Can you explain a bit more about your table and storage engine? Explicit HASH
indexes can only be created for tables based on the MEMORY
and NDB
engines (NDB = MySQL Cluster). Assuming you are not using MySQL Cluster, it seems strange you'd be using the MEMORY
storage engine to store millions of rows.
That said, you can add the KEY_BLOCK_SIZE
hint when creating indexes, which seems to influence the amount of space used for keys: http://dev.mysql.com/doc/refman/5.1/en/create-index.html However, this has got nothing to do in particular with HASH indexes.
In the create table
statement of mysql you can use the MAX_ROWS = ...
table parameter with the NDB
engine. This should create a hash of that size.
精彩评论