summaryrefslogtreecommitdiff
path: root/sql/opt_range.h
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2005-09-30 15:21:37 +0400
committerunknown <sergefp@mysql.com>2005-09-30 15:21:37 +0400
commit1fe423aebaaefdae815662ce555703eb66b3f9e0 (patch)
tree00b61167a0a17a8889f39b5ab9892775c48e78db /sql/opt_range.h
parent7b8a6e458e6bcd3512b2ac2e88e8e02e7f2b4568 (diff)
downloadmariadb-git-1fe423aebaaefdae815662ce555703eb66b3f9e0.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. mysql-test/r/update.result: Testcase for BUG#12915 mysql-test/t/update.test: Testcase for BUG#12915 sql/mysql_priv.h: BUG#12915: Added init_read_record_idx function. sql/opt_range.cc: BUG#12915: Added get_index_for_order() - find an index that can be used to get first N table records in given ordering cheaper then one would with full table scan. sql/opt_range.h: BUG#12915: Added get_index_for_order() function sql/records.cc: BUG#12915: Added init_read_record_idx(), rr_index() that allow to scan index using init_read_record()/read_record.read_record() sql/sql_delete.cc: BUG#12915: Added single-table DELETE ... ORDER BY ... LIMIT optimization: now can use index to find records to delete when there is no WHERE clause. sql/sql_update.cc: BUG#12915: Added single-table UPDATE ... ORDER BY ... LIMIT optimization: now can use index to find records to update when there is no WHERE clause. sql/structs.h: BUG#12915: Added init_read_record_idx(), rr_index() that allow to scan index using init_read_record()/READ_RECORD::read_record()
Diffstat (limited to 'sql/opt_range.h')
-rw-r--r--sql/opt_range.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 87e0315a09e..15f0bf02b34 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -167,4 +167,6 @@ public:
QUICK_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
struct st_table_ref *ref);
+uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit);
+
#endif