Performance improved (memory) using prepared statement in insertOnDuplicateKey