#include <handler.h>
|
| DsMrr_impl (handler *owner) |
|
| ~DsMrr_impl () |
|
void | init (TABLE *table_arg) |
| Initialize the DsMrr_impl object. More...
|
|
int | dsmrr_init (RANGE_SEQ_IF *seq_funcs, void *seq_init_param, uint n_ranges, uint mode, HANDLER_BUFFER *buf) |
| DS-MRR: Initialize and start MRR scan. More...
|
|
void | dsmrr_close () |
|
void | reset () |
| Resets the DS-MRR object to the state it had after being initialized. More...
|
|
int | dsmrr_fill_buffer () |
| DS-MRR: Fill the buffer with rowids and sort it by rowid. More...
|
|
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) |
|
◆ DsMrr_impl()
DsMrr_impl::DsMrr_impl |
( |
handler * |
owner | ) |
|
|
inline |
◆ ~DsMrr_impl()
DsMrr_impl::~DsMrr_impl |
( |
| ) |
|
|
inline |
◆ choose_mrr_impl()
bool DsMrr_impl::choose_mrr_impl |
( |
uint |
keyno, |
|
|
ha_rows |
rows, |
|
|
uint * |
flags, |
|
|
uint * |
bufsz, |
|
|
Cost_estimate * |
cost |
|
) |
| |
|
private |
DS-MRR Internals: Choose between Default MRR implementation and DS-MRR.
Make the choice between using Default MRR implementation and DS-MRR. This function contains common functionality factored out of dsmrr_info() and dsmrr_info_const(). The function assumes that the default MRR implementation's applicability requirements are satisfied.
- Parameters
-
keyno | Index number |
rows | E(full rows to be retrieved) |
flags | IN MRR flags provided by the MRR user OUT If DS-MRR is chosen, flags of DS-MRR implementation else the value is not modified |
bufsz | IN If DS-MRR is chosen, buffer use of DS-MRR implementation else the value is not modified |
cost | IN Cost of default MRR implementation OUT If DS-MRR is chosen, cost of DS-MRR scan else the value is not modified |
- Return values
-
true | Default MRR implementation should be used |
false | DS-MRR implementation should be used |
◆ dsmrr_close()
void DsMrr_impl::dsmrr_close |
( |
| ) |
|
◆ dsmrr_fill_buffer()
int DsMrr_impl::dsmrr_fill_buffer |
( |
| ) |
|
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.
- Return values
-
0 | OK, the next portion of rowids is in the buffer, properly ordered |
other | Error |
◆ dsmrr_info()
ha_rows DsMrr_impl::dsmrr_info |
( |
uint |
keyno, |
|
|
uint |
n_ranges, |
|
|
uint |
keys, |
|
|
uint * |
bufsz, |
|
|
uint * |
flags, |
|
|
Cost_estimate * |
cost |
|
) |
| |
◆ dsmrr_info_const()
◆ dsmrr_init()
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
-
| seq_funcs | Interval sequence enumeration functions |
| seq_init_param | Interval sequence enumeration parameter |
| n_ranges | Number of ranges in the sequence. |
| mode | HA_MRR_* modes to use |
[in,out] | buf | Buffer to use |
- Return values
-
0 | Ok, Scan started. |
other | Error |
◆ dsmrr_next()
int DsMrr_impl::dsmrr_next |
( |
char ** |
range_info | ) |
|
◆ get_disk_sweep_mrr_cost()
bool DsMrr_impl::get_disk_sweep_mrr_cost |
( |
uint |
keynr, |
|
|
ha_rows |
rows, |
|
|
uint |
flags, |
|
|
uint * |
buffer_size, |
|
|
Cost_estimate * |
cost |
|
) |
| |
|
private |
Get cost of DS-MRR scan.
- Parameters
-
keynr | Index to be used |
rows | E(Number of rows to be scanned) |
flags | Scan parameters (HA_MRR_* flags) |
buffer_size | INOUT Buffer size |
cost | OUT The cost |
- Return values
-
false | OK |
true | Error, DS-MRR cannot be used (the buffer is too small for even 1 rowid) |
◆ init()
void DsMrr_impl::init |
( |
TABLE * |
table_arg | ) |
|
|
inline |
Initialize the DsMrr_impl object.
This object is used for both doing default MRR scans and DS-MRR scans. This function just initializes the object. To do a DS-MRR scan, this must also be initialized by calling dsmrr_init().
- Parameters
-
table_arg | pointer to the TABLE that owns the handler |
◆ reset()
void DsMrr_impl::reset |
( |
void |
| ) |
|
Resets the DS-MRR object to the state it had after being initialized.
If there is an open scan then it 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.
◆ dsmrr_eof
bool DsMrr_impl::dsmrr_eof |
|
private |
◆ h2
◆ is_mrr_assoc
bool DsMrr_impl::is_mrr_assoc |
|
private |
◆ rowids_buf
uchar* DsMrr_impl::rowids_buf |
|
private |
◆ rowids_buf_cur
uchar* DsMrr_impl::rowids_buf_cur |
|
private |
◆ rowids_buf_end
uchar* DsMrr_impl::rowids_buf_end |
|
private |
◆ rowids_buf_last
uchar* DsMrr_impl::rowids_buf_last |
|
private |
◆ table
◆ use_default_impl
bool DsMrr_impl::use_default_impl |
|
private |
The documentation for this class was generated from the following files: