Hello Sir,
I have gone through the attached pdfs and understood the scope of work. I will provide you light weight optimize SQL script as well as PHP script which will not consume memory or burden on server unnecessary.
You only need to give me sample data and I will provide you the requested work and can help you to deploy at your server.
Please PM me for further discussion.
Looking forward for your reply.
Thanks & Regards,
Anshulika Bansal