Try to reduce lock contention due to duplicated INSERTS

Change-Id: I875dcfd5a9f991f9f8a2fe8efba11dcc9394ef87