Re: Inverse Lookup in Key-Value Storage: avoid disk seeks
The query is executed quite fast (few ms) during the second run - so I think the result should be cached somewhere. There is no NULL for any key in the map - I added a "NOT NULL" constraint on MYKEY (see below).
SHOW VARIABLES LIKE '%buffer%':
bulk_insert_buffer_size, 8388608
join_buffer_size, 131072
key_buffer_size, 94371840
myisam_sort_buffer_size, 66060288
net_buffer_length, 16384
preload_buffer_size, 32768
read_buffer_size, 65536
read_rnd_buffer_size, 262144
sort_buffer_size, 262144
sql_buffer_result, OFF
SHOW CREATE TABLE map (the "\G" did not work for me):
CREATE TABLE `map` (
`MYKEY` varchar(115) NOT NULL DEFAULT '',
`MYVALUE` int(11) DEFAULT NULL,
PRIMARY KEY (`MYKEY`),
KEY `MYVALUE` (`MYVALUE`,`MYKEY`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1