وردپرس

Database cleaning tool | WordPress.org


The database can accumulate a large amount of information regarding reactions. In my case, wp_wpreactions_reacted_users contains 490830 rows, and the query took 0.3826 seconds. I would like to be able to clean the database by removing all reactions while preserving the number of reactions for each post. I think this is possible because, when I edit a post, I can add or remove the number of reactions for each emoji. I’d like to have a feature that would group the total number of reactions per emoji for each post and save this information in a single row, thus removing all information regarding react_id, react_date, etc… Here’s an example:

  1. I initiate the cleaning tool.
  2. The cleaning tool checks the emojis for each post. Let’s assume we’re analyzing the post with ID “1”.
  3. The number of reactions for all emojis for the post with ID 1 is extracted.
  4. All rows with bind_id = 1 are deleted.
  5. The previously number of reactions we calculated (third step) is saved in a single row.
  6. The process continues with the next post…

For instance, if the post with ID “1” is visited, we check if there are any old reactions to add to the count (those we removed previously), and then any new reactions are added to the total (the ones added to the database after the cleaning process).

I hope I’ve explained myself clearly. This tool would help reduce query execution times as the number of rows in the table is drastically reduced.”

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا