1

Playing around with TokuDB I'm finding even after "optimize table" for things such as changing row compression or other DDLs it takes a non deterministic amount of time for freed space to be reflected in the file system.

Is there anyway to force this more immediately or otherwise view status of if the clean up is in progress or otherwise scheduled?

2 Answers 2

3

Have you simply tried "mysql> show processlist;"? TokuDB displays the progress of optimize operations in plain view.

3
  • Well yes. When you run an "optimize" for example it may take say 30 seconds during which time it's in the process list. What I'm finding though is after it completes (and is no longer in the processlist), it can take some amount of time (1m+) before the actual file in the data directory shrinks.
    – atxdba
    Jul 3, 2014 at 20:33
  • OK, it sounds as if it still needs to complete the upcoming checkpoint before the data in the cache table makes it to disk, and the prior check-pointed blocks can be removed from the file. Jul 3, 2014 at 20:41
  • I do not use TokuDB, so I am learning from those who can answer from experience. +1 !!! Jul 3, 2014 at 22:05
1

Suppose you have a TokuDB table mytable in the mydb database.

You should do a NULL storage engine conversion. In other words, simply convert it to TokuDB again.

ALTER TABLE mydb.mytable ENGINE=TokuDB;
ANALYZE TABLE mydb.mytable;

You can watch the creation of the temp table in /var/lib/mysql/db. Look for any table named *sql-*

If you want to monitor the stages, then convert the table in stages

USE mydb
CREATE TABLE mytable_new LIKE mytable;
INSERT INTO mytable_new SELECT * FROM mytable;
ANALYZE TABLE mydb.mytable_new;
ALTER TABLE mytable RENAME mytable_old;
ALTER TABLE mytable_new RENAME mytable;
DROP TABLE mytable_old;

To monitor it, goto /var/lib/mysql/db and run ls -l mytable*

Give it a Try !!!

UPDATE 2014-07-03 13:53 EDT

MariaDB has progress metering for DDL. I wrote about this in my old post Is there a progress indicator for OPTIMIZE TABLE progress?. You may need to switch to MariaDB and enable TokuDB.

1
  • That was my method of "monitoring", I was hoping for something more informative than polling the file system hoping/wondering when if/when my desired outcome had any effect
    – atxdba
    Jul 3, 2014 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.