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:
parent
6c0724ad1d
commit
fb66dd2c80
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue