MindStalker
MindStalker

Reputation: 14864

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 and 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?

Upvotes: 1

Views: 1079

Answers (2)

Susanne Oberhauser
Susanne Oberhauser

Reputation: 491

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.

Upvotes: 0

Roland Bouman
Roland Bouman

Reputation: 31961

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.

Upvotes: 2

Related Questions