Skip to content

Commit

Permalink
Refactor : update the logic of readonly to get the randome table
Browse files Browse the repository at this point in the history
  • Loading branch information
taojintianxia committed May 5, 2022
1 parent 7accd9b commit 7f650e2
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ public void setup() throws Exception {

@Benchmark
public void oltpReadOnly() throws Exception {
for (PreparedStatement each : preparedStatements) {
each.setInt(1, ThreadLocalRandom.current().nextInt(BenchmarkParameters.TABLE_SIZE));
each.execute();
}
int tableOrder = ThreadLocalRandom.current().nextInt(BenchmarkParameters.TABLES);
preparedStatements[tableOrder].setInt(1, ThreadLocalRandom.current().nextInt(BenchmarkParameters.TABLE_SIZE));
preparedStatements[tableOrder].execute();
connection.commit();
}

Expand Down

0 comments on commit 7f650e2

Please sign in to comment.