Search code examples
mysqltokudb

Speed up tokudb "alter table ... engine=TokuDB”


I'm trying to convert a 400 million row Innodb table to the tokudb engine. When I start with "alter table ... engine=TokuDB" things run really fast in the beginning, (Using SHOW PROCESSLIST) I see it reading in about 1 million rows every 10 seconds. But once I reach about 19-20 million rows, it starts to slow reading and is more like 10k rows every few seconds.

Are there any mysql or tokudb variables that affect the speed of which an ALTER TABLE to tokudb works? I tried the tmp_table_size and some others but can't seem to get past that hurdle.

Any ideas?


Solution

  • Here are the important variables, make sure they are set globally prior to starting the operation or locally within the session executing the storage engine change:

    • tokudb_load_save_space : default is off and should be left alone unless you are low on disk space.
    • tokudb_cache_size : if unset the TokuDB will allocate 50% of RAM for it's own caching mechanism, we generally recommend leaving this setting alone. As you are running on an existing server you need to make sure that you aren't over-committing memory between TokuDB, InnoDB, and MyISAM.