#include <NdbIndexScanOperation.hpp>
virtual int NdbIndexScanOperation::readTuples | ( | LockMode | lock_mode = LM_Read , |
|
Uint32 | scan_flags = 0 , |
|||
Uint32 | parallel = 0 , |
|||
Uint32 | batch = 0 | |||
) | [virtual] |
readTuples using ordered index
lock_mode | Lock mode | |
scan_flags | see ScanFlag | |
parallel | No of fragments to scan in parallel (0=max) |
Reimplemented from NdbScanOperation.
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.
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 |
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::reset_bounds | ( | bool | forceSend = false |
) |
Reset bounds and put operation in list that will be sent on next execute
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::getSorted | ( | ) | const [inline] |
Is current scan sorted
bool NdbIndexScanOperation::getDescending | ( | ) | const [inline] |
Is current scan sorted descending