diff options
Diffstat (limited to 'sql-bench')
-rw-r--r-- | sql-bench/bench-init.pl.sh | 2 | ||||
-rw-r--r-- | sql-bench/server-cfg.sh | 1 | ||||
-rw-r--r-- | sql-bench/test-ATIS.sh | 2 | ||||
-rw-r--r-- | sql-bench/test-alter-table.sh | 36 | ||||
-rw-r--r-- | sql-bench/test-insert.sh | 13 |
5 files changed, 50 insertions, 4 deletions
diff --git a/sql-bench/bench-init.pl.sh b/sql-bench/bench-init.pl.sh index eeff8665cba..f23ef6f5949 100644 --- a/sql-bench/bench-init.pl.sh +++ b/sql-bench/bench-init.pl.sh @@ -566,7 +566,7 @@ All benchmarks takes the following options: When using --fast the suffix is automaticly set to '_fast'. --random - Inform test suite that we are generate random inital values for sequence of + Inform test suite that we are generate random initial values for sequence of test executions. It should be used for imitation of real conditions. --threads=# **DEPRECATED** diff --git a/sql-bench/server-cfg.sh b/sql-bench/server-cfg.sh index 6cc58f527af..e7fd613c50b 100644 --- a/sql-bench/server-cfg.sh +++ b/sql-bench/server-cfg.sh @@ -131,6 +131,7 @@ sub new $limits{'alter_add_multi_col'}= 1; #Have ALTER TABLE t add a int,add b int; $limits{'alter_table'} = 1; # Have ALTER TABLE $limits{'alter_table_dropcol'}= 1; # Have ALTER TABLE DROP column + $limits{'alter_table_after'}= 1; # Have ALTER TABLE .. AFTER other_column $limits{'column_alias'} = 1; # Alias for fields in select statement. $limits{'func_extra_%'} = 1; # Has % as alias for mod() $limits{'func_extra_if'} = 1; # Have function if. diff --git a/sql-bench/test-ATIS.sh b/sql-bench/test-ATIS.sh index 2e082012a8f..c51688de0c2 100644 --- a/sql-bench/test-ATIS.sh +++ b/sql-bench/test-ATIS.sh @@ -369,7 +369,7 @@ sub init_data @class_of_service= $server->create("class_of_service", ["class_code char(2) NOT NULL", - "rank tinyint(2) NOT NULL", + "`rank` tinyint(2) NOT NULL", "class_description char(80) NOT NULL"], ["PRIMARY KEY (class_code)"]); @code_description= diff --git a/sql-bench/test-alter-table.sh b/sql-bench/test-alter-table.sh index 0602bd1f7fc..350c6fae2c6 100644 --- a/sql-bench/test-alter-table.sh +++ b/sql-bench/test-alter-table.sh @@ -202,9 +202,10 @@ while ($field_count > $opt_start_field_count) $count++; $end=max($field_count-$add,$opt_start_field_count); $fields=""; - while(--$field_count >= $end) + while ($field_count > $end) { $fields.=",DROP i${field_count}"; + $field_count--; } $dbh->do("ALTER TABLE bench " . substr($fields,1) . $server->{'drop_attr'}) || die $DBI::errstr; @@ -221,6 +222,39 @@ else print " for alter_table_drop ($count): " . timestr(timediff($end_time, $loop_time),"all") . "\n\n"; +#### +#### Add fields in middle of the table +#### + +goto skip_dropcol if (!$limits->{'alter_table_after'}); + +$count=0; +while ($field_count < $opt_field_count) +{ + $count++; + $end=min($field_count+$add,$opt_field_count); + $fields=""; + $tmp="ADD "; + while ($field_count < $end) + { + $field_count++; + $fields.=",$tmp i${field_count} integer after i1"; + $tmp="" if (!$multi_add); # Adabas + } + do_query($dbh,"ALTER TABLE bench " . substr($fields,1)); + $end_time=new Benchmark; + last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$count, + $opt_field_count/$add+1)); +} + +$end_time=new Benchmark; +if ($estimated) +{ print "Estimated time"; } +else +{ print "Time"; } +print " for alter_table_add_in_middle ($count): " . + timestr(timediff($end_time, $loop_time),"all") . "\n\n"; + skip_dropcol: ################################ END ################################### diff --git a/sql-bench/test-insert.sh b/sql-bench/test-insert.sh index 0cb951d86c8..dbdc58fdcca 100644 --- a/sql-bench/test-insert.sh +++ b/sql-bench/test-insert.sh @@ -993,11 +993,22 @@ $end_time=new Benchmark; print "Time for update_with_key (" . ($opt_loop_count*3) . "): " . timestr(timediff($end_time, $loop_time),"all") . "\n"; +print "Testing update with key, no changes in data\n"; +$loop_time=new Benchmark; +for ($i=0 ; $i < $opt_loop_count*3 ; $i++) +{ + $sth = $dbh->do("update bench1 set dummy1='updated' where id=$i and id2=$i") or die $DBI::errstr; +} + +$end_time=new Benchmark; +print "Time for update_with_key_record_unchanged (" . ($opt_loop_count*3) . "): " . + timestr(timediff($end_time, $loop_time),"all") . "\n"; + $loop_time=new Benchmark; $count=0; for ($i=1 ; $i < $opt_loop_count*3 ; $i+=3) { - $sth = $dbh->do("update bench1 set dummy1='updated' where id=$i") or die $DBI::errstr; + $sth = $dbh->do("update bench1 set dummy1='really updated' where id=$i") or die $DBI::errstr; $end_time=new Benchmark; last if ($estimated=predict_query_time($loop_time,$end_time,\$i,($i-1)/3, $opt_loop_count)); |