I have a database which holds Logentries of several applications. Now I have written a bash-Script which should delete the oldest day when a size limit is exceeded. I have a loop which deletes day per day until the acctual size is smaller then the limit. But after the delete-statements the size of the table is not properly updated.
I used this Sql Statement
'SELECT round(((data_length + index_length)), 0) "Size in Bytes" FROM information_schema.TABLES WHERE table_schema = "Log" AND table_name = "Log";'
to determine the acctual table size. How can I force MySql to recaclulate this size immediately after a delete command?
To access the Refresh from Database dialog box, right-click an object in MySQL Metadata Explorer and click Refresh from Database.
Yes, Views automatically update in MySQL; including, but not limited to: Changing table structures. Insert/Update/Delete procedures on Tables.
RDS for MariaDB, RDS for MySQL, and RDS for PostgreSQL DB instances occasionally require operating system updates. Amazon RDS upgrades the operating system to a newer version to improve database performance and customers' overall security posture. Typically, the updates take about 10 minutes.
To permanently remove a table, enter the following statement within the MySQL shell: DROP TABLE table1; Replace table1 with the name of the table you want to delete. The output confirms that the table has been removed.
Run
OPTIMIZE TABLE Log
After deleting. This will update the index statistics (and free all unused disk-space btw).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With