Class Innodb::Index
In: lib/innodb/index.rb
Parent: Object

An InnoDB index B-tree, given an Innodb::Space and a root page number.

Methods

Classes and Modules

Class Innodb::Index::IndexCursor

Attributes

record_describer  [RW] 
root  [R] 
space  [R] 

Public Class methods

Public Instance methods

Search for a record within the entire index like linear_search, but use the page directory to search while making as few record comparisons as possible. If a matching record is not found, nil is returned.

Return an IndexCursor starting at the given record (an Innodb::Record, :min, or :max) and cursor in the direction given (:forward or :backward).

Iterate through all file segments in the index.

Iterate through all lists in a given fseg.

Iterate through all pages at the given level by finding the first page and following the next pointers in each page.

Iterate through all pages at this level starting with the provided page.

Iterate through all records on all leaf pages in ascending order.

Return the file segment with the given name from the fseg header.

A helper function to access the index ID in the page header.

Search for a record within the entire index, walking down the non-leaf pages until a leaf page is found, and then verifying that the record returned on the leaf page is an exact match for the key. If a matching record is not found, nil is returned (either because linear_search_in_page returns nil breaking the loop, or because compare_key returns non-zero).

Return the last leaf page in the index by walking down the right side of the B-tree until a page at the given level is encountered.

Return the maximum record in the index.

Return the first leaf page in the index by walking down the left side of the B-tree until a page at the given level is encountered.

Return the minimum record in the index.

Return the type of node that the given page represents in the index tree.

Walk an index tree depth-first, calling procs for each page and link in the tree.

[Validate]