845
842
virtual void drop_table(const char *name);
851
A Disk-Sweep MRR interface implementation
853
This implementation makes range (and, in the future, 'ref') scans to read
854
table rows in disk sweeps.
856
Currently it is used by MyISAM and InnoDB. Potentially it can be used with
857
any table handler that has non-clustered indexes and on-disk rows.
863
typedef void (handler::*range_check_toggle_func_t)(bool on);
868
handler *h; /* The "owner" handler object. It is used for scanning the index */
869
Table *table; /* Always equal to h->table */
872
Secondary handler object. It is used to retrieve full table rows by
877
/* Buffer to store rowids, or (rowid, range_id) pairs */
878
unsigned char *rowids_buf;
879
unsigned char *rowids_buf_cur; /* Current position when reading/writing */
880
unsigned char *rowids_buf_last; /* When reading: end of used buffer space */
881
unsigned char *rowids_buf_end; /* End of the buffer */
883
bool dsmrr_eof; /* true <=> We have reached EOF when reading index tuples */
885
/* true <=> need range association, buffer holds {rowid, range_id} pairs */
888
bool use_default_impl; /* true <=> shortcut all calls to default MRR impl */
890
void init(handler *h_arg, Table *table_arg)
895
int dsmrr_init(handler *h, KEY *key, RANGE_SEQ_IF *seq_funcs,
896
void *seq_init_param, uint32_t n_ranges, uint32_t mode,
897
HANDLER_BUFFER *buf);
899
int dsmrr_fill_buffer(handler *h);
900
int dsmrr_next(handler *h, char **range_info);
902
int dsmrr_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys, uint32_t *bufsz,
903
uint32_t *flags, COST_VECT *cost);
905
ha_rows dsmrr_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
906
void *seq_init_param, uint32_t n_ranges, uint32_t *bufsz,
907
uint32_t *flags, COST_VECT *cost);
909
bool key_uses_partial_cols(uint32_t keyno);
910
bool choose_mrr_impl(uint32_t keyno, ha_rows rows, uint32_t *flags, uint32_t *bufsz,
912
bool get_disk_sweep_mrr_cost(uint32_t keynr, ha_rows rows, uint32_t flags,
913
uint32_t *buffer_size, COST_VECT *cost);
916
845
extern const char *ha_row_type[];
917
846
extern const char *tx_isolation_names[];
918
847
extern const char *binlog_format_names[];