summaryrefslogtreecommitdiff
path: root/sql-bench/test-insert.sh
diff options
context:
space:
mode:
authorunknown <monty@tik.mysql.com>2000-10-11 00:06:37 +0300
committerunknown <monty@tik.mysql.com>2000-10-11 00:06:37 +0300
commitda5366886f2c852cb05f8b9b31848d13a4816cad (patch)
treecf18eb0d045153270d68aec8884a4732e953e883 /sql-bench/test-insert.sh
parentdbde9337c201b7a53357d3904c7f0ac5b046ed85 (diff)
downloadmariadb-git-da5366886f2c852cb05f8b9b31848d13a4816cad.tar.gz
Automatic repair of MyISAM tables + portability fixes
Docs/manual.texi: Changes for 3.23 and change Ansi mode -> ANSI mode include/my_base.h: Automatic repair of MyISAM tables include/myisam.h: Automatic repair of MyISAM tables myisam/ft_update.c: Portability fix myisam/mi_check.c: Automatic repair of MyISAM tables myisam/mi_open.c: Automatic repair of MyISAM tables myisam/myisamchk.c: Allow one to combine check with --old-repair myisam/sort.c: Fix for usage of IO_CACHE mysys/charset.c: Portability fixes mysys/default.c: Added --defaults-extra-dir mysys/mf_tempfile.c: Portability fixes mysys/my_init.c: Remove compiler warning mysys/my_pread.c: Remove compiler warning sql-bench/server-cfg.sh: New benchmark tests sql-bench/test-insert.sh: New benchmark tests sql/ha_myisam.cc: Automatic repair of MyISAM tables sql/ha_myisam.h: Automatic repair of MyISAM tables sql/handler.h: Automatic repair of MyISAM tables sql/lock.cc: Add missing free sql/log_event.cc: Portability fixes sql/sql_base.cc: Automatic repair of MyISAM tables sql/sql_select.h: Remove compiler warning sql/sql_table.cc: Clean up intendent sql/sql_yacc.yy: New syntax for CHECK sql/table.cc: Automatic repair of MyISAM tables sql/table.h: Automatic repair of MyISAM tables BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql-bench/test-insert.sh')
-rwxr-xr-xsql-bench/test-insert.sh53
1 files changed, 49 insertions, 4 deletions
diff --git a/sql-bench/test-insert.sh b/sql-bench/test-insert.sh
index 93f6745742e..129c37fac03 100755
--- a/sql-bench/test-insert.sh
+++ b/sql-bench/test-insert.sh
@@ -97,6 +97,8 @@ goto select_test if ($opt_skip_create);
print "Creating tables\n";
$dbh->do("drop table bench1");
+$dbh->do("drop table bench2");
+$dbh->do("drop table bench3");
do_many($dbh,$server->create("bench1",
["id int NOT NULL",
"id2 int NOT NULL",
@@ -240,7 +242,7 @@ if ($limits->{'unique_index'})
}
$end_time=new Benchmark;
-print "Time for insert_duplicates (" . ($total_rows) . "): " .
+print "Time for insert_duplicates (" . ($opt_loop_count) . "): " .
timestr(timediff($end_time, $loop_time),"all") . "\n\n";
#if ($opt_fast && defined($server->{vacuum}))
@@ -611,7 +613,7 @@ if ($limits->{'functions'})
}
$end_time=new Benchmark;
- print "Time for update_of_key ($range_loop_count): " .
+ print "Time for update_of_key ($update_loop_count): " .
timestr(timediff($end_time, $loop_time),"all") . "\n";
if ($opt_lock_tables)
@@ -775,7 +777,7 @@ for ($i=0 ; $i < $opt_loop_count*3 ; $i++)
}
$end_time=new Benchmark;
-print "Time for update_with_key ($opt_loop_count): " .
+print "Time for update_with_key (" . ($opt_loop_count*3) . "): " .
timestr(timediff($end_time, $loop_time),"all") . "\n";
print "\nTesting update of all rows\n";
@@ -785,7 +787,7 @@ for ($i=0 ; $i < $small_loop_count ; $i++)
$sth = $dbh->do("update bench1 set dummy1='updated $i'") or die $DBI::errstr;
}
$end_time=new Benchmark;
-print "Time for update_big ($range_loop_count): " .
+print "Time for update_big ($small_loop_count): " .
timestr(timediff($end_time, $loop_time),"all") . "\n";
@@ -860,6 +862,49 @@ if ($server->small_rollback_segment())
}
####
+#### Test INSERT INTO ... SELECT
+####
+
+if ($limits->{'insert_select'})
+{
+ print "\nTesting INSERT INTO ... SELECT\n";
+ do_many($dbh,$server->create("bench2",
+ ["id int NOT NULL",
+ "id2 int NOT NULL",
+ "id3 int NOT NULL",
+ "dummy1 char(30)"],
+ ["primary key (id,id2)"]));
+ do_many($dbh,$server->create("bench3",
+ ["id int NOT NULL",
+ "id2 int NOT NULL",
+ "id3 int NOT NULL",
+ "dummy1 char(30)"],
+ ["primary key (id,id2)",
+ "index index_id3 (id3)"]));
+ $loop_time=new Benchmark;
+ $sth = $dbh->do("INSERT INTO bench2 SELECT * from bench1") ||
+ die $DBI::errstr;
+ $end_time=new Benchmark;
+ print "Time for insert_select_1_key (1): " .
+ timestr(timediff($end_time, $loop_time),"all") . "\n";
+ $loop_time=new Benchmark;
+ $sth = $dbh->do("INSERT INTO bench3 SELECT * from bench1") ||
+ die $DBI::errstr;
+ $end_time=new Benchmark;
+ print "Time for insert_select_2_keys (1): " .
+ timestr(timediff($end_time, $loop_time),"all") . "\n";
+ $loop_time=new Benchmark;
+ $sth = $dbh->do("DROP TABLE bench2") ||
+ die $DBI::errstr;
+ $sth = $dbh->do("DROP TABLE bench3") ||
+ die $DBI::errstr;
+ $end_time=new Benchmark;
+ print "Time for drop table(2): " .
+ timestr(timediff($end_time, $loop_time),"all") . "\n";
+}
+
+
+####
#### Do some deletes on the table
####