I have been googling and I have ended up completely unsure how to do this.
mysql Ver 14.14 Distrib 5.7.27-30, for debian-linux-gnu (x86_64) using 7.0
Using TokuDB
I have a table with over 2 billion rows. 33GB on disk. With all the indexes, it is a total of 171GB on Disk. It is starting to cause some slowdown issues by pushing some tables into swap.
I have found over 1 billion rows that can be deleted from the table. (and will be more properly maintained going forward…)
The question is, once the rows are deleted:
Is there a way to “hot” reduce the size of the table on disk?
This is a production system and should not have down time.
From some blog posts it appears “OPTIMZE TABLE xxxx;” is the way to go, but some other places it says with TokuDB this can double the size of the table on disk.
Other blog posts say to use “pt-online-schema-change”, but other places say this doesn’t work with TokuDB.
Can you please tell me the proper way to reduce the size on disk after deletion of rows in TokuDB? Is this a “hot” operation, etc.?
Thank you,
Jeff Ward