My Project
Public Types | Public Member Functions | Public Attributes
DsMrr_impl Class Reference

List of all members.

Public Types

typedef void(handler::* range_check_toggle_func_t )(bool on)

Public Member Functions

void init (handler *h_arg, TABLE *table_arg)
int dsmrr_init (handler *h, RANGE_SEQ_IF *seq_funcs, void *seq_init_param, uint n_ranges, uint mode, HANDLER_BUFFER *buf)
void dsmrr_close ()
void reset ()
int dsmrr_fill_buffer ()
int dsmrr_next (char **range_info)
ha_rows dsmrr_info (uint keyno, uint n_ranges, uint keys, uint *bufsz, uint *flags, Cost_estimate *cost)
ha_rows dsmrr_info_const (uint keyno, RANGE_SEQ_IF *seq, void *seq_init_param, uint n_ranges, uint *bufsz, uint *flags, Cost_estimate *cost)

Public Attributes

handlerh
TABLEtable

Member Function Documentation

DS-MRR: Fill the buffer with rowids and sort it by rowid

{This is an internal function of DiskSweep MRR implementation} Scan the MRR ranges and collect ROWIDs (or {ROWID, range_id} pairs) into buffer. When the buffer is full or scan is completed, sort the buffer by rowid and return.

The function assumes that rowids buffer is empty when it is invoked.

Parameters:
hTable handler
Return values:
0OK, the next portion of rowids is in the buffer, properly ordered
otherError
int DsMrr_impl::dsmrr_init ( handler h_arg,
RANGE_SEQ_IF seq_funcs,
void *  seq_init_param,
uint  n_ranges,
uint  mode,
HANDLER_BUFFER buf 
)

DS-MRR: Initialize and start MRR scan

Initialize and start the MRR scan. Depending on the mode parameter, this may use default or DS-MRR implementation.

The DS-MRR implementation will use a second handler object (h2) for doing scan on the index:

  • on the first call to this function the h2 handler will be created and h2 will be opened using the same index as the main handler is set to use. The index scan on the main index will be closed and it will be re-opened to read records from the table using either no key or the primary key. The h2 handler will be deleted when reset() is called (which should happen on the end of the statement).
  • when dsmrr_close() is called the index scan on h2 is closed.
  • on following calls to this function one of the following must be valid: a. if dsmrr_close has been called: the main handler (h) must be open on an index, h2 will be opened using this index, and the index on h will be closed and h will be re-opened to read reads from the table using either no key or the primary key. b. dsmrr_close has not been called: h2 will already be open, the main handler h must be set up to read records from the table (handler->inited is RND) either using the primary index or using no index at all.
Parameters:
h_argTable handler to be used
seq_funcsInterval sequence enumeration functions
seq_init_paramInterval sequence enumeration parameter
n_rangesNumber of ranges in the sequence.
modeHA_MRR_* modes to use
bufINOUT Buffer to use
Return values:
0Ok, Scan started.
otherError
void DsMrr_impl::reset ( void  )

Resets the DS-MRR object to the state it had after being intialized.

If there is an open scan then this will be closed.

This function should be called by handler::ha_reset() which is called when a statement is completed in order to make the handler object ready for re-use by a different statement.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines