I have a table in MySQL that is updated every night with a cron task. Every row is altered, because I'm getting the data from a XLS file and have to update all values.
At first my question was if it worth updating each row or on the other hand just delete all and insert it again. I stick to the UPSERT method as I read that was more adequate, fast and even elegant that throwing out all data, but please correct me if I'm wrong.
WELL, so now my question is about rows that are not new and are not updated each time the cron runs. The XLS maybe has not a fixed length, so one day could be a few lines less... or more.
How can I delete those rows in the same "UPSERT" statement?
Edit: I realized that maybe in this case it is just better to drop old data and re add them, although at first my target was avoiding that.