Maybe this helps - Bruce Wayne?
I am a newbie myself but from what I understand what you are doing is "importing several text files to perform some function" which cases bloating on your backend database because the data being imported has a range between 4000 to 12000 records. Why don't you use a copy of the database that is empty and import the data into it. Then run the various functions and when you get the result you want append the result to the backend table. As for the blank copy of the database use it to do the various functions. I think you can even automate the process if you write a script on paper and follow the steps from beginning to end then using the two table methods you save time and bloating issues.
Just a newbie's suggestion, if it is worth anything to you I'm happy it helps you. Good Luck!