Get Instant Solutions for Kubernetes, Databases, Docker and more
When a developer notices table or index fragmentation in a MySQL database, they can take the following immediate actions:
SELECT table
schema, table
name, Data
free, Data
length,
(Datafree/Data
length)*100 as fragmentation_percentage
FROM information_schema.tables
WHERE ENGINE='InnoDB' AND tableschema NOT IN ('information
schema', 'mysql', 'performance_schema', 'sys');
This will give you an indication of which tables might benefit most from optimization.
[mysqld]
innodbfile
per_table=1
Note that changes to `innodbfilepertable` take effect for new tables only. Existing tables need to be migrated to separate files manually using `ALTER TABLE tablename ENGINE=InnoDB;`.
Remember, before performing actions such as `OPTIMIZE TABLE` or rebuilding indexes on production databases, it's advisable to test these operations in a staging environment first and ensure you have up-to-date backups to avoid data loss.
(Perfect for DevOps & SREs)
(Perfect for DevOps & SREs)
Get Instant Solutions for Kubernetes, Databases, Docker and more
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Block quote
Ordered list
Unordered list
Bold text
Emphasis
Superscript
Subscript
(Perfect for DevOps & SREs)
(Perfect for DevOps & SREs)