# File lib/innodb/index.rb, line 264 def initialize(index, record, direction) Innodb::Stats.increment :index_cursor_create @index = index @direction = direction case record when :min # Start at the minimum record on the minimum page in the index. @page = index.min_page_at_level(0) @page_cursor = @page.record_cursor(:min, direction) when :max # Start at the maximum record on the maximum page in the index. @page = index.max_page_at_level(0) @page_cursor = @page.record_cursor(:max, direction) else # Start at the record provided. @page = record.page @page_cursor = @page.record_cursor(record.offset, direction) end end