Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Cache Table Rebuild

No security coverage Maintenance fixes only 4 sites

This module provides a way to quickly clear very large Drupal cache tables by creating a new, empty table, replacing the old one, and then dropping the original. It adds a user interface for selecting and rebuilding individual cache tables from the performance settings page.

This module takes inspiration from this Stack Overflow answer, to the question of "How can one quickly truncate an enormous database table?" It uses an approach of creating a new version of an existing table, renaming the tables, and then dropping the old table entirely. e.g.

CREATE TABLE new_foo LIKE foo;

RENAME TABLE foo TO old_foo, new_foo TO foo;

DROP TABLE old_foo;

In a Drupal context, this can be useful if you have a cache table which has become inordinately large, such as a case might be if you've had some poorly behaving bots stuck crawling search pages with facet links.

Features

On installing the module, you will have a new tab in the /admin/config/development/performance/ page, titled "Cache Table Rebuild." This page will list all of your cache tables, and their current size. Clicking on the "Rebuild" operation will perform the steps described above, resulting in a new, identical, empty table. Note, the operation will fail if some other process has a lock on the table in question, such as a back up process running at the same time. You will either need to wait for the backup to complete, or kill the process before rebuilding the table.

If you are using this module because of extremely large tables, then it is likely that the backup process might be failing anyway. In these cases, you can display the running process list by:

show full processlist;

And then kill the processs:

KILL <pid>;
Drupal 10–11

Ask your assistant about Cache Table Rebuild

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

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
1
Tracked since
Dec 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.0 Stable 10–11 Dec 2, 2024