I saw a database schema that looked like this
CREATE TABLE foo (
name_hash bigint,
name varachar(500),
a varchar(500),
b varchar(500),
...
PRIMARY KEY (name_hash),
KEY ...
);
This seems to be an attempt to limit index size, by using a 8-byte integer rather than a 100-byte string. When looking up a value by name, the application hashes it, and then uses that hash in the SQL query instead of the name.
This is rather tedious, and I'm not sure if it is necessary.
Is there a feature of MySQL InnoDB that does something similar -- that looks up a string by its much shorter hash in order to fit index into memory?
Or does it do something like that already?