Documentation Home
MySQL Internals Manual


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

23.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
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.