Answer the question
In order to leave comments, you need to log in
Table size in MySql does not shrink when clearing values. How to be?
There is a table that stores information on email newsletters for each user (the subject of the letter, the text of the letter, the sending status, etc.). Approximately 30,000 records per day are added to the table. This increases the table by 300 MB per day
In order to reduce the size of the table, I clear the "mail body" field for all records with the "sent" status. The size in this case should decrease significantly. But that doesn't happen. The table size remains the same.
Why is this happening? How to reduce table size when clearing fields?
The table type is Innodb.
PS. Please do not write messages like "it is better to organize the table differently" and similar messages. The question is different, namely, how to reduce the size of the table by clearing the fields of the records?
Answer the question
In order to leave comments, you need to log in
The question is different, namely, how to reduce the size of the table by clearing the fields of the records?Delete either all or half of the table.
PS. Please do not write messages like "it is better to organize the table differently" and similar messages.Either you just don't know how to do it, or you're too lazy.
I looked through the info a little, it says
1. " That ibdata1 isn't shrinking is a particularly ann... "
2. The InnoDB engine does not support size reduction ...
3. There are also binary logs (they get very clogged), they are cleaned by the command " RESET MASTER" (just be careful - they are used for replication if there are several servers).
Those. in fact, you now have a situation for which it was necessary to prepare in advance . Unfortunately. I do not blame you, I myself was not aware of this MySQL trick.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question