What are the methods of supporting Non-Sequential Reading? MySQL

In addition to table scanning, storage engines can implement methods for non-sequential reading. The MySQL server uses these methods for certain sort operations.

Implementing the position() Method

The position() method is called after every call to rnd_next() if the data needs to be reordered:

The contents of *record are up to you — whatever value you provide will be returned in a later call to retrieve the row. Most storage engines will store some form of offset or primary key value.

Implementing the rnd_pos() Method

The rnd_pos() method behaves in a similar fashion to the rnd_next() method but takes an additional parameter:

The *pos parameter contains positioning information previously recorded using the position() method.

A storage engine must locate the row specified by the position and return it through *buf in the internal MySQL row format.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

MySQL Topics