MySQL Forums
Forum List  »  InnoDB

Re: deleting data from large fragmented InnoDB table
Posted by: Rick James
Date: March 01, 2014 11:06AM

Please provide
EXPLAIN PARTITIONS SELECT * WHERE createdOn = ..., createdBy = ..., requestAction = ...
I want to see if "pruning" occurs. Is suspect it does not, since you use DAY().

Do you always do "SELECT *"?
With
> Avg_row_length: 14058
If you don't always need the BLOBs and LONGTEXTs, there may be some restructuring to speed up some of the queries.

> Data_free: 193741193216

Is that evenly distributed across the partitions? See SHOW TABLE STATUS.

> It will have almoste the same size (about 200 GB), because the new fields will be NULL at the beginning.

"Beginning" of what? The order of fields in CREATE TABLE does not matter. The order of fields in INDEXes matters a lot, but not for index size.

Perhaps the most important question...
What is the DELETE pattern? Do you DELETE whole days? Or something else?

If you are purging "old" data, then I strongly recommend changing the partitioning to something like
http://mysql.rjweb.org/doc.php/partitionmaint

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.