summaryrefslogtreecommitdiff
path: root/sql-bench/test-select.sh
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.fi>2001-03-11 21:20:15 +0200
committerunknown <monty@donna.mysql.fi>2001-03-11 21:20:15 +0200
commit97acb7b3d17dc60f6b879044aa53b7f422f553c2 (patch)
tree3ffab1dce3f9b12f0d98de2289a2022d1e7f3327 /sql-bench/test-select.sh
parent74ea7333032ebc1d396f1939fd5a84c7a6ecc50c (diff)
downloadmariadb-git-97acb7b3d17dc60f6b879044aa53b7f422f553c2.tar.gz
Added new tests to benchmark suite
Docs/manual.texi: Updated some typos in the innobase section client/mysql.cc: Added print of field types (for debugging) client/mysqladmin.c: Added timeout for shutdown mysql-test/mysql-test-run.sh: Use timeout for shutdown sql-bench/test-select.sh: Added test of query cache and new tests for count(distinct) sql/ha_myisam.cc: Don't give warnings for RESTORE TABLE sql/mysqld.cc: Added printing of innobase options sql/sql_lex.cc: Fixed possible bug when OEM sql/sql_table.cc: cleanup
Diffstat (limited to 'sql-bench/test-select.sh')
-rw-r--r--sql-bench/test-select.sh60
1 files changed, 59 insertions, 1 deletions
diff --git a/sql-bench/test-select.sh b/sql-bench/test-select.sh
index e75ee26fff8..3c7efe3c5c2 100644
--- a/sql-bench/test-select.sh
+++ b/sql-bench/test-select.sh
@@ -130,6 +130,37 @@ if ($opt_lock_tables)
select_test:
+if ($limits->{'group_functions'})
+{
+ my ($tmp); $tmp=1000;
+ print "Test if the database has a query cache\n";
+
+ # First ensure that the table is read into memory
+ fetch_all_rows($dbh,"select sum(idn+$tmp),sum(rev_idn+$tmp) from bench1");
+
+ $loop_time=new Benchmark;
+ for ($tests=0 ; $tests < $opt_loop_count ; $tests++)
+ {
+ fetch_all_rows($dbh,"select sum(idn+$tests),sum(rev_idn+$tests) from bench1");
+ }
+ $end_time=new Benchmark;
+ print "Time for select_query_cache ($opt_loop_count): " .
+ timestr(timediff($end_time, $loop_time),"all") . "\n\n";
+
+ # If the database has a query cache, the following loop should be much
+ # slower than the previous loop
+
+ $loop_time=new Benchmark;
+ for ($tests=0 ; $tests < $opt_loop_count ; $tests++)
+ {
+ fetch_all_rows($dbh,"select sum(idn+$tests),sum(rev_idn+$tests) from bench1");
+ }
+ $end_time=new Benchmark;
+ print "Time for select_query_cache2 ($opt_loop_count): " .
+ timestr(timediff($end_time, $loop_time),"all") . "\n\n";
+}
+
+
print "Testing big selects on the table\n";
$loop_time=new Benchmark;
$rows=0;
@@ -288,8 +319,21 @@ if ($limits->{'group_distinct_functions'})
$rows=$estimated=$count=0;
for ($i=0 ; $i < $opt_medium_loop_count ; $i++)
{
- $count+=2;
+ $count++;
$rows+=fetch_all_rows($dbh,"select count(distinct region) from bench1");
+ $end_time=new Benchmark;
+ last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i+1,
+ $opt_medium_loop_count));
+ }
+ print_time($estimated);
+ print " for count_distinct_key_prefix ($count:$rows): " .
+ timestr(timediff($end_time, $loop_time),"all") . "\n";
+
+ $loop_time=new Benchmark;
+ $rows=$estimated=$count=0;
+ for ($i=0 ; $i < $opt_medium_loop_count ; $i++)
+ {
+ $count++;
$rows+=fetch_all_rows($dbh,"select count(distinct grp) from bench1");
$end_time=new Benchmark;
last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i+1,
@@ -304,6 +348,20 @@ if ($limits->{'group_distinct_functions'})
for ($i=0 ; $i < $opt_medium_loop_count ; $i++)
{
$count++;
+ $rows+=fetch_all_rows($dbh,"select count(distinct grp),count(distinct rev_idn) from bench1");
+ $end_time=new Benchmark;
+ last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i+1,
+ $opt_medium_loop_count));
+ }
+ print_time($estimated);
+ print " for count_distinct_2 ($count:$rows): " .
+ timestr(timediff($end_time, $loop_time),"all") . "\n";
+
+ $loop_time=new Benchmark;
+ $rows=$estimated=$count=0;
+ for ($i=0 ; $i < $opt_medium_loop_count ; $i++)
+ {
+ $count++;
$rows+=fetch_all_rows($dbh,"select region,count(distinct idn) from bench1 group by region");
$end_time=new Benchmark;
last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i+1,