You have to see all select, insert or update in this program to database and see if anyone is very slowly. I had a similar problem because a table have not an index and when the table was very large one select was very slowly.