Since you are effectively overwriting the table with new file
contents, the fastest may well be to truncate the table then insert
all contents. If you were to just append and update then
session.merge() is convenient way to do this though I am not sure if
the fastest.
On Sep 7, 5:53 pm, Vlad K.
No, I can't truncate the table for other reasons, as I mentioned in my
original question. :)
The issue here was not how to sync the data, but whether processed rows
stay in session even though the objects (model instances) are discarded
at the end of each iteration (each csv row), or in