WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP-DB-Backup] Here's how to OPTIMIZE tables during backup (1 post)

  1. Pinoy.ca
    Member
    Posted 5 years ago #

    While I do not wish to start a debate why one needs to OPTIMIZE one's WordPress tables as often as one backs them up*, regular optimizing is crucial for tables with several variable-length rows that get many INSERTs and DELETEs, e.g., wp_comments and wp_posts.

    As it happens with the wp-db-backup plugin, this is easily done by adding only one line to the source code.

    $wpdb->get_results("OPTIMIZE TABLE ".implode(", ",$tables));

    The line should be added just before the foreach ($tables as $table) line in the db_backup function. It's at line 897. Note that this affects only the scheduled backup process and not the one via the Admin screen --- that would require another line. :)

    Happy Optimizing!

    *It's debatable, but Yoast seems to agree with me (Tip #17/slide #37).

    http://wordpress.org/extend/plugins/wp-db-backup/

Topic Closed

This topic has been closed to new replies.

About this Topic