As you might know while running GROUP BY and some other kinds of queries MySQL needs to create temporary tables, which can be created in memory, using MEMORY storage engine or can be created on disk as MYISAM tables. Which one will be used depends on the allowed tmp_table_size and also by the data which needs to be put to temporary tables - BLOB/TEXT columns are not supported with MEMORY storage engine so must use on disk MyISAM temporary table.
What i decided to do is to see how much overhead do on disk temporary tables cause compared to MEMORY tables. To have things comparable I used medium size table and types which can be presented both in MEMORY and MyISAM storage engine.
The benchmarks are done with MySQL 5.0.45 on 32bit Fedora Core 6 on Pentium 4 box - something I had available for testing.
PLAIN TEXT SQL:
- CREATE TABLE `gt` (
- `i` int(10) UNSIGNED NOT …