You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The time that the wp site empty command takes to run increases approximately linearly to the number of posts, comments, terms, and taxonomies on the site, because of all the querying and cache clearance that happens. This means it scales very poorly.
In addition, the query to fetch comments for deletion is unbounded, which means memory exhaustion could be experience on a site with a very large number of comments.
Describe how other contributors can replicate this bug
Find yourself a site that contains a large number of posts, for example 100,000 or more.
Run time wp site empty --yes and then go and put the kettle on.
Describe what you would expect as the correct outcome
The time that wp site empty takes to run shouldn't be dictated by the number of objects in the database.
Provide a possible solution
Ideally the cache clearance would happen on a per-group basis to avoid the need to delete every cache entry for every object, but I understand that this is typically not possible.
It may be possible to simply call wp_cache_flush() after truncating all the tables to flush the entire cache, although this will have side effects on a Multisite installation.
The text was updated successfully, but these errors were encountered:
Bug Report
Describe the current, buggy behavior
The time that the
wp site empty
command takes to run increases approximately linearly to the number of posts, comments, terms, and taxonomies on the site, because of all the querying and cache clearance that happens. This means it scales very poorly.In addition, the query to fetch comments for deletion is unbounded, which means memory exhaustion could be experience on a site with a very large number of comments.
Describe how other contributors can replicate this bug
time wp site empty --yes
and then go and put the kettle on.Describe what you would expect as the correct outcome
The time that
wp site empty
takes to run shouldn't be dictated by the number of objects in the database.Provide a possible solution
Ideally the cache clearance would happen on a per-group basis to avoid the need to delete every cache entry for every object, but I understand that this is typically not possible.
It may be possible to simply call
wp_cache_flush()
after truncating all the tables to flush the entire cache, although this will have side effects on a Multisite installation.The text was updated successfully, but these errors were encountered: