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.
MySQL Related Interview Questions
|PHP Interview Questions||MySQL Interview Questions|
|PHP+MySQL Interview Questions||Drupal Interview Questions|
|MYSQL DBA Interview Questions||PHP5 Interview Questions|
|WordPress Interview Questions||Joomla Interview Questions|
|CakePHP Interview Questions||CodeIgniter Interview Questions|
|PHP7 Interview Questions|
A Guided Tour Of The Mysql Source Code
Important Algorithms And Structures
How Mysql Performs Different Selects
How Mysql Transforms Subqueries
Mysql Client/server Protocol
Prepared Statements And Stored Routines
Myisam Storage Engine
Innodb Storage Engine
Writing A Custom Storage Engine
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.