summaryrefslogtreecommitdiff
path: root/sql-bench
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-12-18 05:34:00 +0200
committerunknown <monty@hundin.mysql.fi>2001-12-18 05:34:00 +0200
commit20038678cff13261f886b3fdb7e2f04fae1386b5 (patch)
treefd9b8b5be51e148f724af20f6edf3f0a36ba06a3 /sql-bench
parent29fabf3a33511005676fca9cc8b818f63cf107f7 (diff)
downloadmariadb-git-20038678cff13261f886b3fdb7e2f04fae1386b5.tar.gz
Updated benchmarks
Portability fixes. Fixed bug in mysqlbinlog when detecting binary log version client/mysqlbinlog.cc: Fixed bug when detecting binary log version configure.in: Portability fix for HPUX mysql-test/mysql-test-run.sh: Portability fix sql-bench/bench-init.pl.sh: Updated benchmarks sql-bench/run-all-tests.sh: Updated benchmarks sql-bench/server-cfg.sh: Updated benchmarks sql-bench/test-ATIS.sh: Updated benchmarks sql-bench/test-connect.sh: Updated benchmarks
Diffstat (limited to 'sql-bench')
-rw-r--r--sql-bench/bench-init.pl.sh13
-rw-r--r--sql-bench/run-all-tests.sh16
-rw-r--r--sql-bench/server-cfg.sh86
-rw-r--r--sql-bench/test-ATIS.sh2
-rw-r--r--sql-bench/test-connect.sh2
5 files changed, 89 insertions, 30 deletions
diff --git a/sql-bench/bench-init.pl.sh b/sql-bench/bench-init.pl.sh
index 17da59429f6..4e7e1c29504 100644
--- a/sql-bench/bench-init.pl.sh
+++ b/sql-bench/bench-init.pl.sh
@@ -44,6 +44,8 @@ $opt_server="mysql"; $opt_dir="output";
$opt_host="localhost";$opt_database="test";
$opt_machine=""; $opt_suffix="";
$opt_create_options=undef;
+$opt_optimization="None";
+$opt_hw="";
$opt_threads=5;
$opt_time_limit=10*60; # Don't wait more than 10 min for some tests
@@ -51,9 +53,9 @@ $opt_time_limit=10*60; # Don't wait more than 10 min for some tests
$log_prog_args=join(" ", skip_arguments(\@ARGV,"comments","cmp","server",
"user", "host", "database", "password",
"use-old-results","skip-test",
+ "optimization","hw",
"machine", "dir", "suffix", "log"));
-GetOptions("skip-test=s","comments=s","cmp=s","server=s","user=s","host=s","database=s","password=s","loop-count=i","row-count=i","skip-create","skip-delete","verbose","fast-insert","lock-tables","debug","fast","force","field-count=i","regions=i","groups=i","time-limit=i","log","use-old-results","machine=s","dir=s","suffix=s","help","odbc","small-test","small-tables","small-key-tables","stage=i","threads=i","random","old-headers","die-on-errors","create-options=s","hires","tcpip","silent",
-"socket=s") || usage();
+GetOptions("skip-test=s","comments=s","cmp=s","server=s","user=s","host=s","database=s","password=s","loop-count=i","row-count=i","skip-create","skip-delete","verbose","fast-insert","lock-tables","debug","fast","force","field-count=i","regions=i","groups=i","time-limit=i","log","use-old-results","machine=s","dir=s","suffix=s","help","odbc","small-test","small-tables","small-key-tables","stage=i","threads=i","random","old-headers","die-on-errors","create-options=s","hires","tcpip","silent","optimization=s","hw=s","socket=s") || usage();
usage() if ($opt_help);
$server=get_server($opt_server,$opt_host,$opt_database,$opt_odbc,
@@ -585,6 +587,13 @@ All benchmarks takes the following options:
--verbose
This is a test specific option that is only used when debugging a test.
Print more information about what is going on.
+
+--optimization='some comments'
+ Add coments about optimization of DBMS, which was done before the test.
+
+--hw='some comments'
+ Add coments about hardware used for this test.
+
EOF
exit(0);
}
diff --git a/sql-bench/run-all-tests.sh b/sql-bench/run-all-tests.sh
index eb07d85be03..f392431140c 100644
--- a/sql-bench/run-all-tests.sh
+++ b/sql-bench/run-all-tests.sh
@@ -109,7 +109,9 @@ print "Running tests on: $machine\n";
print "Arguments: $log_prog_args\n";
print "Comments: $opt_comments\n";
print "Limits from: $opt_cmp\n";
-print "Server version: $server_version\n\n";
+print "Server version: $server_version\n";
+print "Optimization: $opt_optimization\n";
+print "Hardware: $opt_hw\n\n";
$estimated=$warning=$got_warning=0;
@@ -285,10 +287,6 @@ sub read_headers
{
$log_prog_args=$1;
}
- elsif (/^Comments.*:\s+(.*)$/)
- {
- $opt_comments=$1;
- }
elsif (/^Limits.*:\s+(.*)$/)
{
$opt_cmp=$1;
@@ -297,6 +295,14 @@ sub read_headers
{
$server_version=$1;
}
+ elsif (/^Optimiz.*:\s+(.*)$/)
+ {
+ $opt_optimization=$1;
+ }
+ elsif (/^Hardwar.*:\s+(.*)$/)
+ {
+ $opt_hw=$1;
+ }
}
close(TMP);
}
diff --git a/sql-bench/server-cfg.sh b/sql-bench/server-cfg.sh
index 744a2217a96..b8c37e5922e 100644
--- a/sql-bench/server-cfg.sh
+++ b/sql-bench/server-cfg.sh
@@ -2248,7 +2248,6 @@ sub fix_for_insert
#############################################################################
# Configuration for Sybase
#############################################################################
-
package db_sybase;
sub new
@@ -2259,10 +2258,10 @@ sub new
bless $self;
$self->{'cmp_name'} = "sybase";
- $self->{'data_source'} = "DBI:ODBC:$database";
+ $self->{'data_source'} = "DBI:Sybase:database=$database";
if (defined($host) && $host ne "")
{
- $self->{'data_source'} .= ":$host";
+ $self->{'data_source'} .= ";hostname=$host";
}
$self->{'limits'} = \%limits;
$self->{'smds'} = \%smds;
@@ -2327,7 +2326,19 @@ sub new
sub version
{
my ($self)=@_;
- return "Sybase enterprise 11.5 NT"; #DBI/ODBC can't return the server version
+ my ($dbh,$sth,$version,@row);
+
+ $dbh=$self->connect();
+ $sth = $dbh->prepare('SELECT @@version') or die $DBI::errstr;
+ $version="Sybase (unknown)";
+ if ($sth->execute && (@row = $sth->fetchrow_array))
+ {
+ $version=$row[0];
+ }
+ $sth->finish;
+ $dbh->disconnect;
+ return $version;
+
}
sub connect
@@ -2335,7 +2346,7 @@ sub connect
my ($self)=@_;
my ($dbh);
$dbh=DBI->connect($self->{'data_source'}, $main::opt_user,
- $main::opt_password,{ PrintError => 0}) ||
+ $main::opt_password,{ PrintError => 0 , AutoCommit => 1}) ||
die "Got error: '$DBI::errstr' when connecting to " . $self->{'data_source'} ." with user: '$main::opt_user' password: '$main::opt_password'\n";
return $dbh;
}
@@ -2428,7 +2439,9 @@ sub fix_for_insert
#
# optimize the tables ....
-#
+# WARNING (from walrus)! This sub will work only from DBD:sybase
+# driver. Because if we use ODBC we don't know actual database name
+# (but DSN name only)
sub vacuum
{
my ($self,$full_vacuum,$dbh_ref)=@_;
@@ -2440,7 +2453,25 @@ sub vacuum
}
$dbh=$$dbh_ref;
$loop_time=new Benchmark;
- $dbh->do("analyze table ?? compute statistics") || die "Got error: $DBI::errstr when executing 'vacuum'\n";
+ my (@tables,$sth,$current_table,$current_base);
+ $dbh->do("dump tran $database with truncate_only");
+ $sth=$dbh->prepare("sp_tables" ) or die "prepere";
+ $sth->execute() or die "execute";
+ while (@row = $sth->fetchrow_array()) {
+ $current_table = $row[2];
+ $current_base = $row[0];
+ next if ($current_table =~ /^sys/);
+ push(@tables,$current_table) if ($database == $current_base);
+ }
+
+ $sth->finish();
+
+ foreach $table (@tables) {
+# print "$table: \n";
+ $dbh->do("update statistics $table") or print "Oops!";
+ }
+
+# $dbh->do("analyze table ?? compute statistics") || die "Got error: $DBI::errstr when executing 'vacuum'\n";
$end_time=new Benchmark;
print "Time for book-keeping (1): " .
Benchmark::timestr(Benchmark::timediff($end_time, $loop_time),"all") . "\n\n";
@@ -2448,6 +2479,8 @@ sub vacuum
}
+
+
#############################################################################
# Definitions for Adabas
#############################################################################
@@ -2935,7 +2968,6 @@ sub new
$smds{'q15'} = 'd';
$smds{'q16'} = 'a';
$smds{'q17'} = 'c';
-
return $self;
}
@@ -2984,23 +3016,35 @@ sub connect
sub create
{
my($self,$table_name,$fields,$index,$options) = @_;
- my($query,@queries);
+ my($query,@queries,@indexes);
$query="create table $table_name (";
foreach $field (@$fields)
{
$field =~ s/ decimal/ double(10,2)/i;
$field =~ s/ big_decimal/ double(10,2)/i;
- $field =~ s/ date/ int/i; # Because of tcp ?
+ $field =~ s/ tinyint\(.*\)/ smallint/i;
+ $field =~ s/ smallint\(.*\)/ smallint/i;
+ $field =~ s/ mediumint/ integer/i;
+ $field =~ s/ float\(.*\)/ float/i;
+# $field =~ s/ date/ int/i; # Because of tcp ?
$query.= $field . ',';
}
foreach $index (@$index)
{
- $query.= $index . ',';
+ if ( $index =~ /\bINDEX\b/i )
+ {
+ my @fields = split(' ',$index);
+ my $query="CREATE INDEX $fields[1] ON $table_name $fields[2]";
+ push(@indexes,$query);
+
+ } else {
+ $query.= $index . ',';
+ }
}
substr($query,-1)=")"; # Remove last ',';
$query.=" $options" if (defined($options));
- push(@queries,$query);
+ push(@queries,$query,@indexes);
return @queries;
}
@@ -3360,13 +3404,13 @@ sub version
my ($self)=@_;
my ($dbh,$sth,$version,@row);
- $dbh=$self->connect();
+# $dbh=$self->connect();
#
# Pick up SQLGetInfo option SQL_DBMS_VER (18)
#
#$version = $dbh->func(18, GetInfo);
- $version="FrontBase 2.1";
- $dbh->disconnect;
+ $version="FrontBase 3.3";
+# $dbh->disconnect;
return $version;
}
@@ -3401,7 +3445,7 @@ sub connect
sub create
{
my($self,$table_name,$fields,$index,$options) = @_;
- my($query,@queries);
+ my($query,@queries,@indexes,@keys);
$query="create table $table_name (";
foreach $field (@$fields)
@@ -3419,18 +3463,18 @@ sub create
}
foreach $ind (@$index)
{
- my @index;
- if ( $ind =~ /\bKEY\b/i ){
+# my @index;
+ if ( $ind =~ /(\bKEY\b)|(\bUNIQUE\b)/i ){
push(@keys,"ALTER TABLE $table_name ADD $ind");
}else{
- my @fields = split(' ',$index);
+ my @fields = split(' ',$ind);
my $query="CREATE INDEX $fields[1] ON $table_name $fields[2]";
- push(@index,$query);
+ push(@indexes,$query);
}
}
substr($query,-1)=")"; # Remove last ',';
$query.=" $options" if (defined($options));
- push(@queries,$query);
+ push(@queries,$query,@keys,@indexes);
return @queries;
}
diff --git a/sql-bench/test-ATIS.sh b/sql-bench/test-ATIS.sh
index da866f2eb66..ac3d7360198 100644
--- a/sql-bench/test-ATIS.sh
+++ b/sql-bench/test-ATIS.sh
@@ -224,7 +224,7 @@ print "Retrieving data\n";
"SELECT airport.country_name,state.state_name,city.city_name,airport_service.direction FROM airport_service,state,airport,city WHERE airport_service.city_code=city.city_code AND airport_service.airport_code=airport.airport_code AND state.state_code=airport.state_code AND state.state_code=city.state_code AND airport.state_code=city.state_code AND airport.country_name=city.country_name AND airport.country_name=state.country_name AND city.time_zone_code=airport.time_zone_code GROUP BY airport.country_name,state.state_name,city.city_name,airport_service.direction ORDER BY state_name DESC",11,$limits->{'group_functions'},
"SELECT airport.country_name,state.state_name,city.city_name,airport_service.direction FROM airport_service,state,airport,city WHERE airport_service.city_code=city.city_code AND airport_service.airport_code=airport.airport_code AND state.state_code=airport.state_code AND state.state_code=city.state_code AND airport.state_code=city.state_code AND airport.country_name=city.country_name AND airport.country_name=state.country_name AND city.time_zone_code=airport.time_zone_code GROUP BY airport.country_name,state.state_name,city.city_name,airport_service.direction ORDER BY state_name",11,$limits->{'group_functions'},
"SELECT from_airport,to_airport,fare.fare_class,night,one_way_cost,rnd_trip_cost,class_days FROM compound_class,fare WHERE compound_class.fare_class=fare.fare_class AND one_way_cost <= 825 AND one_way_cost >= 280 AND from_airport='SFO' AND to_airport='DFW' GROUP BY from_airport,to_airport,fare.fare_class,night,one_way_cost,rnd_trip_cost,class_days ORDER BY one_way_cost",10,$limits->{'group_functions'},
- "select engines,category,cruising_speed,from_airport,to_airport FROM aircraft,flight WHERE category='JET' AND ENGINES >= 1 AND aircraft.aircraft_code=flight.aircraft_code AND to_airport NOT LIKE from_airport AND stops>0 GROUP BY engines,category,cruising_speed,from_airport,to_airport ORDER BY engines DESC",29,$limits->{'group_functions'} && $limits->{'like_with_column'},
+ "select engines,category,cruising_speed,from_airport,to_airport FROM aircraft,flight WHERE category='JET' AND engines >= 1 AND aircraft.aircraft_code=flight.aircraft_code AND to_airport NOT LIKE from_airport AND stops>0 GROUP BY engines,category,cruising_speed,from_airport,to_airport ORDER BY engines DESC",29,$limits->{'group_functions'} && $limits->{'like_with_column'},
);
@Q=(\@Q1,\@Q2,\@Q21,\@Q3,\@Q4);
diff --git a/sql-bench/test-connect.sh b/sql-bench/test-connect.sh
index 50778ce572c..0f1aca5aaa7 100644
--- a/sql-bench/test-connect.sh
+++ b/sql-bench/test-connect.sh
@@ -311,7 +311,7 @@ $sth = $dbh->do("drop table bench1" . $server->{'drop_attr'})
or do
{
# Fix for Access 2000
- die $dbh->errstr if (!$dbh->abort_if_fatal_error());
+ die $dbh->errstr if (!$server->abort_if_fatal_error());
};
if ($opt_fast && defined($server->{vacuum}))