Optimizing the Uploading of huge amount of records/data
<p>Team...I have a problem when it comes to uploading of 2500 to 4000 records of data, it takes time to wait or sometimes it times out in the server.</p>

<p>Im using ExtJS 3.4.0, PHP 5.5.31 and PostgreSQL for my application in our development server.</p>

<p>My application has 3 tabs, the first tab is the <strong>Uploading</strong> tab, in which i will select a template (in a excel form <strong>xlsx</strong>) and upload its contents. The other tabs are just used for viewing and downloading the template. The main focus is the uploading tab.</p>

<p>In my PHP code, loops the records (based on the max rows in the excel)</p>

<ul>
<li>it has validations to check each record being looped</li>
<li>it checks if the data record exist in the table then update that data, if not then insert new record</li>
</ul>

<p>The problem here is that, it takes time like 20 to 25 minutes...is there a way to optimize this scenario? </p>

<p>Thanks!</p>