Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Optimize Database Tables

43 sites Security covered Drupal 10–11
View on drupal.org

This module helps keep your Drupal site performing efficiently by optimizing your database tables. It offers an administrative interface and a Drush command to manage this process, allowing you to choose which tables to optimize and view the space savings.

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

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Oct 2025
Latest release
5 months ago
Releases (12 mo)
4 ▲ from 0
Maintenance
Active

Release Timeline

Releases

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