
这五条语句执行完毕能够删除掉95%以上的数据,算的上是极限优化了。通过上面对 wp_postmeta 数据表的优化和清理,我们的数据库瘦身不少,执行效率也有所提升。
实际只使用前四条 最后一条为保险起见 不用
The wp_postmeta data table is used to sTore the information attached to the article in WordPress. The data in it is useless except in some specific cases. Here are a few sentences to make your wp_postmeta table clean. Please back up the database before proceeding. Then execute the following SQL statement to clean up and optimize the junk files and cache in the wp_postmeta data table. The following two statements test that safe deletion is not dangerous.
DELETE FROM wp_postmeta WHERE meta_key ='_edit_lock';
DELETE FROM wp_postmeta WHERE meta_key ='_edit_last';
The following are three newly tried sentences, the first two are not very dangerous. The last one is not clear about the current role, but there is no abnormality after deletion.
DELETE FROM wp_postmeta WHERE meta_key ='_wp_old_slug';
DELETE FROM wp_postmeta WHERE meta_key ='_revision-control';
DELETE FROM wp_postmeta WHERE meta_value ='{{unknown}}';
After these five statements are executed, more than 95% of the data can be deleted, which is a limit optimization. Through the above optimization and cleaning of the wp_postmeta data table, our database has been slimmed down a lot, and the execution efficiency has also been improved.
Actually only use the first four and the last one is for insurance purposes.