DB Maintenance

jgraham - December 18, 2005 - 10:21

DB maintenance optimizes administrator-selected tables in the database during regular cron.php executions. For MyISAM tables, OPTIMIZE TABLE repairs a table if it has deleted or split rows, sorts table indexes, and updates table statistics. For BDB and InnoDB, OPTIMIZE rebuilds the table. Note, MySQL locks tables during the time OPTIMIZE TABLE is running. Optionally the user can select to attempt a REPAIR TABLE in the event errors are found during attempted OPTIMIZE TABLE. If you enable this ensure you have proper working backups.

OPTIMIZE works best on tables with large deletions (e.g. cache or watchdog), however MySQL will reuse old record positions, therefore in most setups, OPTIMIZE TABLE is unnecessary unless you just like defragmenting. The Overhead column in phpMyAdmin's database view is the most common way to determine the need of an OPTIMIZE TABLE query. It essentially shows the amount of disk space you would recover by running an optimize/defragmentation query.

Think of OPTIMIZE TABLE like defragmenting your hard drive. Sure your system will run without it, and it might even be fast, but isn't it nice to run a defrag when you can?

6.x+ PostgreSQL support: Per PostgreSQL documentation's recommendation, this module does not use the VACUUM FULL operation that locks the tables; this module can operate in parallel with normal reading and writing of PostgreSQL tables.

5.x and 6.x-2.x only: You can optionally backup the files and database to an arbitrary location on disk, and optionally notify a list of users via email of the backup availability.

Releases

Official releasesDateSizeLinksStatus
6.x-2.0-beta22009-Apr-2111.89 KBSupported for 6.xThis release is supported but is not currently the recommended release for 6.x.
6.x-1.12008-May-289.07 KBRecommended for 6.xThis is currently the recommended release for 6.x.
5.x-2.12008-Oct-0112.4 KBSupported for 5.xThis release is supported but is not currently the recommended release for 5.x.
5.x-1.22007-Jan-288.84 KBRecommended for 5.xThis is currently the recommended release for 5.x.


 
 

Drupal is a registered trademark of Dries Buytaert.