Since there are only a few records (1500+) in the database:
- load all records from the database into memory,
- start reading every line in the updated input file
- see if there is an exact match with the records in memory
- if there is not, insert the record into the database with a link to the original db record
For your selects:
- If the 'link' column is empty it is an 'actual record'
- If there is a value in the link column, you can use that to select the records that need to be compared by the user
When your database becomes too large to load everything into memory, you'll have to switch to batch processing (using PL/SQL or T-SQL or...) or change the process somewhat.