diff options
author | monty@hundin.mysql.fi <> | 2001-11-08 15:54:22 +0200 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-11-08 15:54:22 +0200 |
commit | 0fb61f0e2b9b81135558f3c7852f91a744ebd60f (patch) | |
tree | f041c20e4bea9553dbfec4de709b72029a800b95 /sql-bench/test-select.sh | |
parent | 11f34156e52575fd0b8a042085dbf02638d1c727 (diff) | |
download | mariadb-git-0fb61f0e2b9b81135558f3c7852f91a744ebd60f.tar.gz |
--fast now does all insert/update loops in one transactions
Diffstat (limited to 'sql-bench/test-select.sh')
-rw-r--r-- | sql-bench/test-select.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql-bench/test-select.sh b/sql-bench/test-select.sh index eba2a7085d8..62e978a945f 100644 --- a/sql-bench/test-select.sh +++ b/sql-bench/test-select.sh @@ -92,6 +92,12 @@ if ($opt_fast && defined($server->{vacuum})) print "Inserting $opt_loop_count rows\n"; $loop_time=new Benchmark; + +if ($opt_fast && $server->{transactions}) +{ + $dbh->{AutoCommit} = 0; +} + $query="insert into bench1 values ("; $half_done=$opt_loop_count/2; for ($id=0,$rev_id=$opt_loop_count-1 ; $id < $opt_loop_count ; $id++,$rev_id--) @@ -105,6 +111,12 @@ for ($id=0,$rev_id=$opt_loop_count-1 ; $id < $opt_loop_count ; $id++,$rev_id--) } } +if ($opt_fast && $server->{transactions}) +{ + $dbh->commit; + $dbh->{AutoCommit} = 1; +} + $end_time=new Benchmark; print "Time to insert ($opt_loop_count): " . timestr(timediff($end_time, $loop_time),"all") . "\n\n"; |