Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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

share|improve this answer
    
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 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. –  tmcallaghan Jul 3 at 20:41
    
I do not use TokuDB, so I am learning from those who can answer from experience. +1 !!! –  RolandoMySQLDBA Jul 3 at 22:05

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.

share|improve this answer
    
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 at 17:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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