Cache Table Rebuild
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>;
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
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.0 | Stable | Dec 2, 2024 |