From 3e6f87ce7b4b3b5cf727485e8a3b4ecf2aadadf8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jun 2001 03:06:23 -0400 Subject: Implement ORDER BY DESC optimization, which reads values in descending order directly from the index instead of using a filesort. mysql-test/mysql-test-run.sh: [ -n $SKIP_TEST ] --> [ -n "$SKIP_TEST" ]; portability fix mysql-test/r/order_by.result: Added test for ORDER BY DESC optimization mysql-test/t/order_by.test: Added test for ORDER BY DESC optimization sql/opt_range.cc: Added QUICK_SELECT_DESC class which implements ORDER BY DESC optimization. sql/opt_range.h: Added QUICK_SELECT_DESC class which implements ORDER BY DESC optimization. sql/sql_select.cc: Added QUICK_SELECT_DESC class which implements ORDER BY DESC optimization. BitKeeper/etc/ignore: Added .gdbinit .vimrc to the ignore list BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- sql/opt_range.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sql/opt_range.h') diff --git a/sql/opt_range.h b/sql/opt_range.h index 247dd260817..0c8dcf7fed3 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -80,6 +80,20 @@ public: bool unique_key_range(); }; +class QUICK_SELECT_DESC: public QUICK_SELECT +{ +public: + QUICK_SELECT_DESC(QUICK_SELECT *q); + int get_next(); +private: + int cmp_prev(QUICK_RANGE *range); + bool range_reads_after_key(QUICK_RANGE *range); + + QUICK_SELECT *quick; + List rev_ranges; + List_iterator rev_it; +}; + class SQL_SELECT :public Sql_alloc { public: QUICK_SELECT *quick; // If quick-select used -- cgit v1.2.1