I'm using SQL Server and I have a table related N-1 to another table and I have a process that updates the information of the N table by removing all the related rows and inserting them again.
I could do a search in the table and check if the row I'm going to insert already exists, but that will require to compare every column and its a lot easier to me just to deleted them all and inserting them back.
This causes the primary key to grow and grow and I'm concerned about the performance in the future.
So, the question is, will this cause a reduction of the queries in the future and it's a lot better to update the rows or this is not a problem at all?
Thanks
EDIT: I'm not deleting all the rows every time, I'm just deleting the related rows, so if I have 3 new rows to insert, I search the current ones, delete them and insert the new ones