One trick I have used is creating a SHA checksum on each row in the database that I wanted to compare against. Then do the same on your input files. If you precalculate the database field, you can even store the SHA and primary key of the destination field elsewhere. Comparing two SHA keys is very quick and you will not pound your database or alter any schema that your DBA would get upset about.
There are many approaches depending on what level of compare you need to perform.