optimize_database_tables
22 sites
Security covered
Optimize Database Tables keeps your Drupal site lean by running OPTIMIZE on MySQL/MariaDB tables & VACUM on PostgreSQL tables, with a simple admin UI and Drush command, per-table control, and clear before/after space savings.
Features
- Optimize all database tables or only a selected list.
- Admin UI with safe, batch-based execution and progress feedback.
- Drush command with progress bar and optional per-table details.
- Summary messages showing total size before/after and space saved.
- Minimal configuration: choose "All tables" or maintain a table list.
Post-Installation
- Go to Configuration → System → Optimize Database Tables (path:
/admin/config/system/database_optimize_tables). - Choose whether to optimize all tables or select specific tables.
- Start the optimization from the UI, or run it via Drush:
drush optimize_database_tables:run # Alias drush optimize-dbt:run # Show per-table details drush optimize-dbt:run --details
The UI uses Drupal's Batch API so processes are resilient to timeouts. After completion, you will see before/after sizes and the amount of space reclaimed.
Additional Requirements
- Drupal core 10 or 11.
- Database: MySQL, MariaDB & PostgreSQL
- Optional: Drush for command-line usage.
Similar projects
- OptimizeDB — A Drupal module focused on optimizing MySQL/MariaDB tables.
- DB Maintenance — Provides general database maintenance tasks and scheduling options.
Supporting this Module
Feedback and contributions are welcome via the issue queue. If you find this useful, consider reporting your use case and results to help guide future improvements.
Community Documentation
- README in the project repository covers features, services, routes, and troubleshooting.
Notes:
- On large tables, optimization can take time and may lock tables temporarily—run during low-traffic periods.
- Always ensure you have a recent backup before running database maintenance.
- This module targets MySQL/MariaDB & PostgreSQL