Emulate mako.c's commit behavior during populate()

This commit is contained in:
Junhyun Shim 2022-04-25 10:44:20 +02:00
parent 3205fe8ca4
commit 6224ea834b
1 changed files with 1 additions and 1 deletions

View File

@ -184,7 +184,7 @@ int populate(Transaction tx,
stats.incrOpCount(OP_INSERT);
/* commit every 100 inserts (default) or if this is the last key */
if (i == key_end || (i - key_begin + 1) % num_commit_every == 0) {
if ((i % num_commit_every == 0) || i == key_end) {
const auto do_sample = (stats.getOpCount(OP_TRANSACTION) % args.sampling) == 0;
auto watch_commit = Stopwatch(StartAtCtor{});
auto future_commit = tx.commit();