Bug #45838 feature request: create/use handler func's read_range_last and read_range_prev
Submitted: 29 Jun 2009 19:57 Modified: 30 Jun 2009 8:28
Reporter: Zardosht Kasheff (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Storage Engines Severity:S4 (Feature request)
Version:5.1.35 OS:Any
Assigned to: CPU Architecture:Any
Tags: Storage Engine API

[29 Jun 2009 19:57] Zardosht Kasheff
Description:
The handler interface has functions read_range_first, read_range_next, read_multi_range_first and read_multi_range_next for range queries. In opt_range.cc, in the function QUICK_RANGE_SELECT::get_next, these functions are used to perform range queries in the storage engine.

These API's are very helpful for the storage engine. They provide the storage engine with notification of what range is to be read. As a result, storage engines can use this information to optimize their range queries.

The analogous API's do not exist for queries that are read in reverse order (such as "select * from foo use_index(a) where a BETWEEN 10 and 20 order by a desc". Having them in QUICK_SELECT_DESC::get_next would be very helpful.

How to repeat:
n/a

Suggested fix:
Create functions handler::read_range_last and handler::read_range_prev with the same signature as handler::read_range_first and handler::read_range_next. Use them in QUICK_SELECT_DESC::get_next.
[30 Jun 2009 8:28] Valeriy Kravchuk
Thank you for the feature request.