diff options
author | sergefp@mysql.com <> | 2005-09-30 15:21:37 +0400 |
---|---|---|
committer | sergefp@mysql.com <> | 2005-09-30 15:21:37 +0400 |
commit | e9f2f9437a9c7be83db93d3461ce6e77245d1df4 (patch) | |
tree | 00b61167a0a17a8889f39b5ab9892775c48e78db /mysql-test/r/update.result | |
parent | bd417d158ea1d4f262186ac73dbe3615d322c229 (diff) | |
download | mariadb-git-e9f2f9437a9c7be83db93d3461ce6e77245d1df4.tar.gz |
BUG#12915: Added single-table UPDATE/DELTE ... ORDER BY ... LIMIT
optimization: now can use index to find records to update/delete
when there is no WHERE clause.
Diffstat (limited to 'mysql-test/r/update.result')
-rw-r--r-- | mysql-test/r/update.result | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index d6c1118f90c..cf07487febc 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -263,3 +263,62 @@ test delete from t1 where count(*)=1; ERROR HY000: Invalid use of group function drop table t1; +create table t1 ( a int, index (a) ); +insert into t1 values (0),(0),(0),(0),(0),(0),(0),(0); +flush status; +select a from t1 order by a limit 1; +a +0 +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +flush status; +update t1 set a=unix_timestamp() order by a limit 1; +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 1 +Handler_read_rnd_next 0 +flush status; +delete from t1 order by a limit 1; +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +flush status; +delete from t1 order by a desc limit 1; +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 1 +Handler_read_rnd_next 9 +alter table t1 disable keys; +flush status; +delete from t1 order by a limit 1; +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 1 +Handler_read_rnd_next 9 +select count(*) from t1; +count(*) +5 +drop table t1; |