1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Implement ORDER BY DESC optimization, which reads values in descending

order directly from the index instead of using a filesort.
This commit is contained in:
tim@white.box
2001-06-28 03:06:23 -04:00
parent 85388703c4
commit 5ed2cf7dbe
8 changed files with 263 additions and 6 deletions

View File

@ -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<QUICK_RANGE> rev_ranges;
List_iterator<QUICK_RANGE> rev_it;
};
class SQL_SELECT :public Sql_alloc {
public:
QUICK_SELECT *quick; // If quick-select used