Documentation Home
MySQL Internals Manual
Download this Manual
EPUB - 0.8Mb


MySQL Internals Manual  /  ...  /  Implementing the index_read_last() Method

22.16.10 Implementing the index_read_last() Method

The [custom-engine.html#custom-engine-api-reference-index_read_last index_read_last()] method works like [custom-engine.html#custom-engine-index-read index_read()] but finds the last row with the current key value or prefix:

int ha_foo::index_read_last(byte * buf, const byte * key,
                            key_part_map keypart_map)

index_read_last() is used when optimizing away the ORDER BY clause for statements such as this:

SELECT * FROM t1 WHERE a=1 ORDER BY a DESC,b DESC; 

User Comments
Sign Up Login You must be logged in to post a comment.