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.

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.

If you are using prefixed tables you will need to upgrade to 6.x-1.2 for this module to work correctly.

Downloads

Recommended releases

Version Downloads Date Links
7.x-1.1 tar.gz (10.46 KB) | zip (11.93 KB) 2012-Apr-13 Notes
6.x-1.4 tar.gz (10.36 KB) | zip (11.8 KB) 2012-Feb-08 Notes

Development releases

Version Downloads Date Links
7.x-1.x-dev tar.gz (10.48 KB) | zip (11.95 KB) 2012-Mar-30 Notes

Project Information


Maintainers for DB Maintenance

  • deekayen - 37 commits
    last: 14 weeks ago, first: 7 years ago
  • cYu - 1 commit
    last: 3 years ago, first: 3 years ago
  • jgraham - 7 commits
    last: 4 years ago, first: 4 years ago

Issues for DB Maintenance

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
Statistics (2 years)
New issues
Open bugs
Participants
nobody click here