diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-11 22:26:41 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-11 22:26:41 +0200 |
| commit | fbc2ac2fa52d3d69451787f5ec9ebb0e0657c877 (patch) | |
| tree | 625497d7b6e2cf33d2f05b2c722254ad436e1a32 | |
| parent | c43e7c17ffd2c69afa9de1e2321289506f5e27c2 (diff) | |
| download | shrinker-fbc2ac2fa52d3d69451787f5ec9ebb0e0657c877.tar.gz shrinker-fbc2ac2fa52d3d69451787f5ec9ebb0e0657c877.zip | |
disable unique checks in transaction to boost performance
| -rw-r--r-- | worker.js | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 |
