Read the documentation of the Affiliate System and check on how to solve the problem in while importing the database. The solution is to increase the post size to 64M but this wasn't enough but improve the query capacity as the rows carries 38k rows.