121
121
=================
122
122
[Warning: this description is work in progress and may be incomplete]
123
123
The table record is stored in a fixed-size buffer:
125
125
record: null_bytes, column1_data, column2_data, ...
127
The offsets of the parts of the buffer are also fixed: every column has
127
The offsets of the parts of the buffer are also fixed: every column has
128
128
an offset to its column{i}_data, and if it is nullable it also has its own
131
131
The record buffer only includes data about columns that are marked in the
132
132
relevant column set (table->read_set and/or table->write_set, depending on
134
134
<not-sure>It could be that it is required that null bits of non-present
135
135
columns are set to 1</not-sure>
137
137
VARIOUS EXCEPTIONS AND SPECIAL CASES
139
f the table has no nullable columns, then null_bytes is still
140
present, its length is one byte <not-sure> which must be set to 0xFF
139
f the table has no nullable columns, then null_bytes is still
140
present, its length is one byte <not-sure> which must be set to 0xFF
141
141
at all times. </not-sure>
143
143
If the table has columns of type BIT, then certain bits from those columns
144
144
may be stored in null_bytes as well. Grep around for Field_bit for
147
For blob columns (see Field_blob), the record buffer stores length of the
148
data, following by memory pointer to the blob data. The pointer is owned
147
For blob columns (see Field_blob), the record buffer stores length of the
148
data, following by memory pointer to the blob data. The pointer is owned
149
149
by the storage engine and is valid until the next operation.
151
151
If a blob column has NULL value, then its length and blob data pointer
317
317
{ return rows2double(ranges+rows); }
319
319
virtual double index_only_read_time(uint32_t keynr, double records);
321
321
virtual ha_rows multi_range_read_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
322
void *seq_init_param,
322
void *seq_init_param,
323
323
uint32_t n_ranges, uint32_t *bufsz,
324
324
uint32_t *flags, COST_VECT *cost);
325
325
virtual int multi_range_read_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys,
682
682
This method offers the storage engine, the possibility to store a reference
683
to a table name which is going to be used with query cache.
683
to a table name which is going to be used with query cache.
684
684
The method is called each time a statement is written to the cache and can
685
685
be used to verify if a specific statement is cachable. It also offers
686
686
the possibility to register a generic (but static) call back function which
738
738
The pushed conditions form a stack (from which one can remove the
739
739
last pushed condition using cond_pop).
740
The table handler filters out rows using (pushed_cond1 AND pushed_cond2
740
The table handler filters out rows using (pushed_cond1 AND pushed_cond2
741
741
AND ... AND pushed_condN)
742
742
or less restrictive condition, depending on handler's capabilities.
744
744
handler->ha_reset() call empties the condition stack.
745
745
Calls to rnd_init/rnd_end, index_init/index_end etc do not affect the
748
748
virtual const COND *cond_push(const COND *cond) { return cond; }
892
892
This procedure defines if the storage engine supports virtual columns.
893
893
Default false means "not supported".
895
virtual bool check_if_supported_virtual_columns(void)
895
virtual bool check_if_supported_virtual_columns(void)
896
896
{ return false; }
1003
1003
virtual void start_bulk_insert(ha_rows)
1005
1005
virtual int end_bulk_insert(void) { return 0; }
1006
virtual int index_read(unsigned char *, const unsigned char *,
1006
virtual int index_read(unsigned char *, const unsigned char *,
1007
1007
uint32_t, enum ha_rkey_function)
1008
1008
{ return HA_ERR_WRONG_COMMAND; }
1009
1009
virtual int index_read_last(unsigned char *, const unsigned char *, uint32_t)
1068
1068
A Disk-Sweep MRR interface implementation
1070
1070
This implementation makes range (and, in the future, 'ref') scans to read
1071
table rows in disk sweeps.
1071
table rows in disk sweeps.
1073
1073
Currently it is used by MyISAM and InnoDB. Potentially it can be used with
1074
1074
any table handler that has non-clustered indexes and on-disk rows.
1107
1107
void init(handler *h_arg, Table *table_arg)
1110
1110
table= table_arg;
1112
int dsmrr_init(handler *h, KEY *key, RANGE_SEQ_IF *seq_funcs,
1113
void *seq_init_param, uint32_t n_ranges, uint32_t mode,
1112
int dsmrr_init(handler *h, KEY *key, RANGE_SEQ_IF *seq_funcs,
1113
void *seq_init_param, uint32_t n_ranges, uint32_t mode,
1114
1114
HANDLER_BUFFER *buf);
1115
1115
void dsmrr_close();
1116
1116
int dsmrr_fill_buffer(handler *h);
1119
1119
int dsmrr_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys, uint32_t *bufsz,
1120
1120
uint32_t *flags, COST_VECT *cost);
1122
ha_rows dsmrr_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
1122
ha_rows dsmrr_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
1123
1123
void *seq_init_param, uint32_t n_ranges, uint32_t *bufsz,
1124
1124
uint32_t *flags, COST_VECT *cost);
1126
1126
bool key_uses_partial_cols(uint32_t keyno);
1127
bool choose_mrr_impl(uint32_t keyno, ha_rows rows, uint32_t *flags, uint32_t *bufsz,
1127
bool choose_mrr_impl(uint32_t keyno, ha_rows rows, uint32_t *flags, uint32_t *bufsz,
1128
1128
COST_VECT *cost);
1129
bool get_disk_sweep_mrr_cost(uint32_t keynr, ha_rows rows, uint32_t flags,
1129
bool get_disk_sweep_mrr_cost(uint32_t keynr, ha_rows rows, uint32_t flags,
1130
1130
uint32_t *buffer_size, COST_VECT *cost);