diff options
author | unknown <monty@hundin.mysql.fi> | 2001-11-08 15:54:22 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-11-08 15:54:22 +0200 |
commit | 40bfbe0bfaaa1bedf9dd7ff5fdcb836eb102911d (patch) | |
tree | f041c20e4bea9553dbfec4de709b72029a800b95 /sql-bench/test-big-tables.sh | |
parent | 897e7453d6c669f7460a242a81b874bd0302007b (diff) | |
download | mariadb-git-40bfbe0bfaaa1bedf9dd7ff5fdcb836eb102911d.tar.gz |
--fast now does all insert/update loops in one transactions
Diffstat (limited to 'sql-bench/test-big-tables.sh')
-rw-r--r-- | sql-bench/test-big-tables.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sql-bench/test-big-tables.sh b/sql-bench/test-big-tables.sh index ac942f2b571..151a169d31f 100644 --- a/sql-bench/test-big-tables.sh +++ b/sql-bench/test-big-tables.sh @@ -127,14 +127,28 @@ end_benchmark($start_time); sub test_query { my($test_text,$result_text,$query,$dbh,$count)=@_; - my($i,$loop_time,$end_time); + my($i,$loop_time,$end_time, $using_transactions); print $test_text . "\n"; $loop_time=new Benchmark; + + $using_transactions=0; + if ($opt_fast && server->{transactions} && $query=~ /^insert /i) + { + $using_transactions=1; + $dbh->{AutoCommit} = 0; + print "Transactions enabled\n" if ($opt_debug); + } for ($i=0 ; $i < $count ; $i++) { defined(fetch_all_rows($dbh,$query)) or die $DBI::errstr; } + if ($using_transactions) + { + $dbh->commit; + $dbh->{AutoCommit} = 1; + } + $end_time=new Benchmark; print $result_text . "($count): " . timestr(timediff($end_time, $loop_time),"all") . "\n\n"; |