Replace DELETE FROM to TRUNCATE to empty woocommerce_sessions table

If the size of the woocommerce_sessions table is 3.2 GB before the
Clear all sessions button is clicked, then it will delete all rows, but
leave the table size 3.2. Truncating/emptying the table resets the size
of the table, and deletes all rows.
This commit is contained in:
toddlahman 2016-03-24 21:24:36 -07:00
parent 6c0724ad1d
commit fb66dd2c80
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ class WC_Admin_Status {
break;
case 'clear_sessions' :
$wpdb->query( "DELETE FROM {$wpdb->prefix}woocommerce_sessions" );
$wpdb->query( "TRUNCATE {$wpdb->prefix}woocommerce_sessions" );
wp_cache_flush();