Details
Description
It seems that the RDBDocumentStoreJDBC.update() method contains a redundant SELECT statement, between the UPDATE and INSERT phase. It's used to find out whether we should INSERT remaining documents or if they already exists in the DB. However, we may skip the middle SELECT and try to INSERT all documents with mod_count = 1.
The second possible optimisation in this method is skipping the first bulk UPDATE operation if there are no documents to be updated.