From fbc2ac2fa52d3d69451787f5ec9ebb0e0657c877 Mon Sep 17 00:00:00 2001 From: schneefux Date: Tue, 11 Apr 2017 22:26:41 +0200 Subject: disable unique checks in transaction to boost performance --- worker.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/worker.js b/worker.js index a3054e6..07878fe 100644 --- a/worker.js +++ b/worker.js @@ -284,6 +284,7 @@ function snakeCaseKeys(obj) { // upsert whole batch in parallel await seq.transaction({ autocommit: false }, async (transaction) => { console.log("inserting batch into db"); + await seq.query("SET unique_checks=0"); await Promise.all([ model.Match.bulkCreate(match_records, { include: [ model.Roster, model.Asset ], @@ -321,6 +322,7 @@ function snakeCaseKeys(obj) { transaction: transaction }) ]); + await seq.query("SET unique_checks=1"); // update last_match_created_date and skill tier for players // that were explicitely pushed into processor -- cgit v1.3.1