Optimizing the CEL table does not free up disk space.

The CEL table is already completely filling up the disk, we have been deleting some rows from the table and now we are trying to optimize the table to free up space, but it is not working.

Captura de Pantalla 2023-03-30 a la(s) 2.25.09 p. m.

Captura de Pantalla 2023-03-30 a la(s) 2.34.14 p. m.

Relational databases generally do not release the underlying file system space unless remove and re-add a table. Doing a delete will simply mark individual records as free. Files can’t normally be made sparse again once a block has actually been allocated.

Also, typically tables share a single file, so optimising a table may actually free blocks in the table, but they will still be in the middle of the database file and can’t be released to the underlying file system. I think one needs to do a backup, recreate, and restore to recover that space.

(I think SQL Server allows tables to be allocated to particular OS files, in which case you may be able drop some tables, recreate the extent, and reload the table. I’m not sure if MySQL has this capability. Looks like it does have something similar:

)

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.