diff options
author | unknown <monty@mashka.mysql.fi> | 2003-06-27 03:04:54 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-06-27 03:04:54 +0300 |
commit | c2cb9b97be721d07e9cb2a27076c8beaf22f304b (patch) | |
tree | 6fef037dd6b940bf2ed11b3042a97c08dc6b364c /mysql-test/r/select_safe.result | |
parent | 7539980eb1e70144c8f1232271e4f24311426312 (diff) | |
download | mariadb-git-c2cb9b97be721d07e9cb2a27076c8beaf22f304b.tar.gz |
Added thread variable max_seeks_for_key
Change optimizer to prefer key lookups before table scan
Change table scans to be done after tables with constrains on scanned table
mysql-test/r/distinct.result:
Update results
mysql-test/r/group_by.result:
Update results
mysql-test/r/heap.result:
Update results
mysql-test/r/join.result:
Update results
mysql-test/r/key_diff.result:
Update results
mysql-test/r/myisam.result:
Update results
mysql-test/r/order_by.result:
Update results
mysql-test/r/select_safe.result:
Update results
mysql-test/t/distinct.test:
Change test to be repeatable
mysql-test/t/join.test:
Change test to be repeatable
mysql-test/t/select_safe.test:
Add tests for MAX_SEEKS_FOR_KEY
sql/handler.h:
Optimize structure for 64 bit machines (and to avoid problems with gdb)
sql/item_cmpfunc.cc:
Initialize not_null_tables_cache properly
sql/mysqld.cc:
Added max_seeks_for_key
sql/set_var.cc:
Added max_seeks_for_key
sql/sql_class.h:
Added max_seeks_for_key
sql/sql_select.cc:
Added max_seeks_for_key
Change optimizer to prefer key lookups before table scan.
Change table scans to be done after tables with constrains on scanned table
Diffstat (limited to 'mysql-test/r/select_safe.result')
-rw-r--r-- | mysql-test/r/select_safe.result | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result index 3303f19d9c7..830390ebe3c 100644 --- a/mysql-test/r/select_safe.result +++ b/mysql-test/r/select_safe.result @@ -1,6 +1,6 @@ drop table if exists t1; SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, SQL_MAX_JOIN_SIZE=9; -create table t1 (a int auto_increment primary key, b char(20)); +create table t1 (a int auto_increment primary key, b char(20), key(b)); insert into t1 values(1,"test"); SELECT SQL_BUFFER_RESULT * from t1; a b @@ -13,7 +13,7 @@ a b 1 test 2 test2 update t1 set b="a" where a=1; -select 1 from t1,t1 as t2,t1 as t3,t1 as t4; +select 1 from t1,t1 as t2,t1 as t3; 1 1 1 @@ -22,11 +22,9 @@ select 1 from t1,t1 as t2,t1 as t3,t1 as t4; update t1 set b="a"; You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column update t1 set b="a" where b="test"; -You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column delete from t1; You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column delete from t1 where b="test"; -You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column delete from t1 where a+0=1; You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5; @@ -59,5 +57,22 @@ a b 2 test2 4 a 5 a +SELECT @@MAX_SEEKS_FOR_KEY; +@@max_seeks_for_key +4294967295 +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"); +explain select * from t1,t1 as t2 where t1.b=t2.b; +table type possible_keys key key_len ref rows Extra +t1 ALL b NULL NULL NULL 21 +t2 ALL b NULL NULL NULL 16 Using where +set MAX_SEEKS_FOR_KEY=1; +explain select * from t1,t1 as t2 where t1.b=t2.b; +table type possible_keys key key_len ref rows Extra +t1 ALL b NULL NULL NULL 21 +t2 ref b b 21 t1.b 6 Using where +SET MAX_SEEKS_FOR_KEY=DEFAULT; drop table t1; SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT; |