Knowledgebase

Managing Database Size and Growth Print

  • developersgitdeployment, developers, database, performance, troubleshooting, domainrenewal, backup, plugins, spam, migration
  • 0

Databases grow, and growth causes problems.

WHAT GROWS

Log and audit tables Revisions, in content systems Expired sessions and transient data Spam comments Orders and their metadata, in shops Analytics and tracking tables added by plugins

FINDING THE LARGE TABLES

Query the information schema for table sizes, sorted largest first. That identifies the problem immediately.

REDUCING IT

Delete genuinely obsolete data, with a backup taken first Limit revisions Clear expired transients and sessions Remove tables belonging to plugins you no longer use, which are frequently left behind Archive old records to a separate table or export them

OPTIMISING

After large deletions, optimising the table reclaims the space. Deleted rows do not release space automatically.

WHY IT MATTERS

Every query on a large table is slower Backups take longer and consume more space Imports and migrations become difficult You may approach plan limits

A ROUTINE

Check table sizes quarterly. Growth is gradual until it is a problem.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot