An expired member cleanup tool written in PHP is slow to run.

Source: Internet
Author: User
An expired member cleanup tool written in PHP is slow. the master table is a member table.
About 150 member record tables

Task objective: to clear expired member and member records

My idea is to delete records one by one on a table by members.
Then, each member is divided into 100 tables in a group. The deletion effect is slightly improved, but it is still very slow.
When more than 1000 members are deleted at the same time, the operation is basically unsuccessful.

I don't know how many experts have encountered similar situations. how do you solve this problem? thanks.


Reply to discussion (solution)

Slow is also an SQL problem
Please provide your db structure

Check the expired members to see how fast they are. Is it because your time field is not indexed?
And what data engine is used for your table.
If yes, add a field directly and update the member as deleted without deleting it?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.