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-alter-table.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-alter-table.sh')
-rw-r--r-- | sql-bench/test-alter-table.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sql-bench/test-alter-table.sh b/sql-bench/test-alter-table.sh index 276c4863d8c..af0f630d938 100644 --- a/sql-bench/test-alter-table.sh +++ b/sql-bench/test-alter-table.sh @@ -74,11 +74,25 @@ do_many($dbh,$server->create("bench",\@fields,\@index)); print "Insert data into the table\n"; $loop_time=new Benchmark; + +if ($opt_fast && defined($server->{transactions})) +{ + $dbh->{AutoCommit} = 0; + print "Transactions enabled\n" if ($opt_debug); +} + for ($i=0 ; $i < $opt_row_count ; $i++) { $query="insert into bench values ( " . ("$i," x ($opt_start_field_count-1)) . "$i)"; $dbh->do($query) or die $DBI::errstr; } + +if ($opt_fast && defined($server->{transactions})) +{ + $dbh->commit; + $dbh->{AutoCommit} = 1; +} + $end_time=new Benchmark; print "Time for insert ($opt_row_count)", |