mysql memory存储引擎(也称heap table)是一种高效的内存数据库,速度非常快,或可当作cache使用,适合需要对cache作关系查询的数据,可参考我以前的文章:
memcached vs MySQL Memory engine table 速度比较
但是mysql memory table有一些性能问题,其中之一就是varchar数据类型内存利用率不高,ebay也在使用这个特性,所以他的一位工程师解决了这个问题,并凭此和另外一个工具获得了
2008 MySQL Application of the Year
项目地址:
http://code.google.com/p/mysql-heap-dynamic-rows/
As of March 2008, MySQL Heap Engine of any version is limited to fixed row format. It allocates fixed memory size for each record stored in a given Heap Table. For example, if table A has a VARCHAR(4000) column, MySQL will use at least 4000 bytes (plus other columns and per-record overhead) for every record regardless of whether it has that much user data. In this example, the table will use 4GB memory per 1M records.