How to optimize databases to reduce bloat

1 min read

Here at GridPane, we’ve opted to use InnoDB as the default storage engine for SQL. It’s typically more performant than other storage engines like MyISAM. However, it does have one flaw:

As you add data, the InnoDB table file is allocated more space and the file physically grows in size on the server. The InnoDB table handler does not reclaim that allocated space when data inside that file is deleted. You might have a 5GB table with only 100MB of actual data.

Here are a couple of easy ways to fix this:

Use WPCLI using our GPCLI command, gp -wp $site $wp_cli_command $arg_1 $arg_2 $arg_3 $arg_n . For example, “gp -wp site.com db optimize”.

Use a plugin like WP Optimize (https://wordpress.org/plugins/wp-optimize/).

Use PHPmyadmin or a desktop SQL client like MySQL.