I have an application where I get information about products everyday.
The file's size is about 18MB. Everyday, products may be added, updated
or deleted.

Which is more efficient way to update teh database,
1. delete all rows and then again insert data again.
2. programatically check which product has changed and only update

I have to use PHP. Each line in the file is about a product and each
field is tab separated. Any one of the field may change. So, I would
have to check each and every field which incurs one more problem, data
has to be transfered in and out of the database server.

So I wanted to know which one of the method is more efficient.