mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 11:45:32 +00:00
Added option --temporary-tables to test speed of temporary tables
mysql-test/suite/parts/t/partition_repair_myisam-master.opt: Added missing file from last push sql-bench/bench-init.pl.sh: Added options: --temporary-tables to test speed of temporary tables sql-bench/server-cfg.sh: Added limit for number of temporary tables one can create sql-bench/test-connect.sh: Skip test that doesn't work with temporary tables. sql-bench/test-create.sh: Added limit for number of temporary tables one can create
This commit is contained in:
@ -161,41 +161,48 @@ if ($opt_fast && defined($server->{vacuum}))
|
||||
{
|
||||
$server->vacuum(0,\$dbh);
|
||||
}
|
||||
$dbh->disconnect;
|
||||
if (!$main::opt_temporary_tables)
|
||||
{
|
||||
$dbh->disconnect;
|
||||
}
|
||||
|
||||
#
|
||||
# First test connect/select/disconnect
|
||||
#
|
||||
print "Testing connect/select 1 row from table/disconnect\n";
|
||||
|
||||
$loop_time=new Benchmark;
|
||||
$errors=0;
|
||||
|
||||
for ($i=0 ; $i < $small_loop_count ; $i++)
|
||||
if (!$main::opt_temporary_tables)
|
||||
{
|
||||
for ($j=0; $j < $max_test ; $j++)
|
||||
print "Testing connect/select 1 row from table/disconnect\n";
|
||||
|
||||
$loop_time=new Benchmark;
|
||||
$errors=0;
|
||||
|
||||
for ($i=0 ; $i < $small_loop_count ; $i++)
|
||||
{
|
||||
last if ($dbh = DBI->connect($server->{'data_source'}, $opt_user, $opt_password));
|
||||
$errors++;
|
||||
}
|
||||
die $DBI::errstr if ($j == $max_test);
|
||||
for ($j=0; $j < $max_test ; $j++)
|
||||
{
|
||||
last if ($dbh = DBI->connect($server->{'data_source'}, $opt_user, $opt_password));
|
||||
$errors++;
|
||||
}
|
||||
die $DBI::errstr if ($j == $max_test);
|
||||
|
||||
$sth = $dbh->do("select a,i,s,$i from bench1") # Select * from table with 1 record
|
||||
$sth = $dbh->do("select a,i,s,$i from bench1") # Select * from table with 1 record
|
||||
or die $DBI::errstr;
|
||||
$dbh->disconnect;
|
||||
}
|
||||
$dbh->disconnect;
|
||||
}
|
||||
|
||||
$end_time=new Benchmark;
|
||||
print "Warning: $errors connections didn't work without a time delay\n" if ($errors);
|
||||
print "Time to connect+select_1_row ($small_loop_count): " .
|
||||
$end_time=new Benchmark;
|
||||
print "Warning: $errors connections didn't work without a time delay\n" if ($errors);
|
||||
print "Time to connect+select_1_row ($small_loop_count): " .
|
||||
timestr(timediff($end_time, $loop_time),"all") . "\n\n";
|
||||
|
||||
$dbh = $server->connect();
|
||||
}
|
||||
|
||||
#
|
||||
# The same test, but without connect/disconnect
|
||||
#
|
||||
print "Testing select 1 row from table\n";
|
||||
|
||||
$dbh = $server->connect();
|
||||
$loop_time=new Benchmark;
|
||||
|
||||
for ($i=0 ; $i < $opt_loop_count ; $i++)
|
||||
|
Reference in New Issue
Block a user