NdbIndexScanOperation Class Reference

#include <NdbIndexScanOperation.hpp>

Inheritance diagram for NdbIndexScanOperation:

NdbScanOperation NdbOperation List of all members.

Detailed Description

Class of scan operations for use to scan ordered index.

Public Types

Public Member Functions


Member Enumeration Documentation

enum NdbIndexScanOperation::BoundType
 

Type of ordered index key bound. The values (0-4) will not change and can be used explicitly (e.g. they could be computed).

Enumerator:
BoundLE  lower bound
BoundLT  lower bound, strict
BoundGE  upper bound
BoundGT  upper bound, strict
BoundEQ  equality


Member Function Documentation

int NdbIndexScanOperation::end_of_bound Uint32  range_no  ) 
 

Marks end of a bound, used when batching index reads (multiple ranges)

int NdbIndexScanOperation::get_range_no  ) 
 

Return range no for current row

bool NdbIndexScanOperation::getDescending  )  const [inline]
 

Is current scan sorted descending

bool NdbIndexScanOperation::getSorted  )  const [inline]
 

Is current scan sorted

virtual int NdbIndexScanOperation::readTuples LockMode  lock_mode = LM_Read,
Uint32  scan_flags = 0,
Uint32  parallel = 0
[virtual]
 

readTuples using ordered index

Parameters:
lock_mode Lock mode
scan_flags see ScanFlag
parallel No of fragments to scan in parallel (0=max)

Reimplemented from NdbScanOperation.

int NdbIndexScanOperation::reset_bounds bool  forceSend = false  ) 
 

Reset bounds and put operation in list that will be sent on next execute

int NdbIndexScanOperation::setBound Uint32  anAttrId,
int  type,
const void *  aValue,
Uint32  len = 0
 

Define bound on index key in range scan using index column id. See the other setBound() method for details.

int NdbIndexScanOperation::setBound const char *  attr,
int  type,
const void *  value,
Uint32  len = 0
 

Define bound on index key in range scan.

Each index key can have lower and/or upper bound. Setting the key equal to a value defines both upper and lower bounds. The bounds can be defined in any order. Conflicting definitions is an error.

For equality, it is better to use BoundEQ instead of the equivalent pair of BoundLE and BoundGE. This is especially true when table partition key is an initial part of the index key.

The sets of lower and upper bounds must be on initial sequences of index keys. All but possibly the last bound must be non-strict. So "a >= 2 and b > 3" is ok but "a > 2 and b >= 3" is not.

The scan may currently return tuples for which the bounds are not satisfied. For example, "a <= 2 and b <= 3" scans the index up to (a=2, b=3) but also returns any (a=1, b=4).

NULL is treated like a normal value which is less than any not-NULL value and equal to another NULL value. To compare against NULL use setBound with null pointer (0).

An index stores also all-NULL keys. Doing index scan with empty bound set returns all table tuples.

Parameters:
attr Attribute name, alternatively:
type Type of bound
value Pointer to bound value, 0 for NULL
len Value length in bytes. Fixed per datatype and can be omitted
Returns:
0 if successful otherwise -1


Documentation generated Mon Nov 28 11:48:20 2005 from mysql source files.
© 2003-2004 MySQL AB