Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

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

  1. Go to Configuration → System → Optimize Database Tables (path: /admin/config/system/database_optimize_tables).
  2. Choose whether to optimize all tables or select specific tables.
  3. 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

Activity

Total releases
4
First release
Oct 2025
Latest release
1 month ago
Release cadence
51 days
Stability
100% stable

Release Timeline

Releases

Version Type Release date
1.2.1 Stable Mar 7, 2026
1.2.0 Stable Mar 1, 2026
1.1.0 Stable Oct 18, 2025
1.0.0 Stable Oct 6, 2025