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?