mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
always call start_bulk_insert, clarify this behaviour in comment block
change 10 to a #define'd constant
This commit is contained in:
@ -417,6 +417,7 @@ typedef struct st_mi_sort_param
|
|||||||
#define MI_MIN_SIZE_BULK_INSERT_TREE 16384 /* this is per key */
|
#define MI_MIN_SIZE_BULK_INSERT_TREE 16384 /* this is per key */
|
||||||
#define MI_MIN_ROWS_TO_USE_BULK_INSERT 100
|
#define MI_MIN_ROWS_TO_USE_BULK_INSERT 100
|
||||||
#define MI_MIN_ROWS_TO_DISABLE_INDEXES 100
|
#define MI_MIN_ROWS_TO_DISABLE_INDEXES 100
|
||||||
|
#define MI_MIN_ROWS_TO_USE_WRITE_CACHE 10
|
||||||
|
|
||||||
/* The UNIQUE check is done with a hashed long key */
|
/* The UNIQUE check is done with a hashed long key */
|
||||||
|
|
||||||
|
@ -868,7 +868,7 @@ void ha_myisam::start_bulk_insert(ha_rows rows)
|
|||||||
ulong size= min(thd->variables.read_buff_size, table->avg_row_length*rows);
|
ulong size= min(thd->variables.read_buff_size, table->avg_row_length*rows);
|
||||||
|
|
||||||
/* don't enable row cache if too few rows */
|
/* don't enable row cache if too few rows */
|
||||||
if (!rows && rows > 10)
|
if (!rows && rows > MI_MIN_ROWS_TO_USE_WRITE_CACHE)
|
||||||
mi_extra(file, HA_EXTRA_WRITE_CACHE, (void*) &size);
|
mi_extra(file, HA_EXTRA_WRITE_CACHE, (void*) &size);
|
||||||
|
|
||||||
can_enable_indexes= (file->s->state.key_map ==
|
can_enable_indexes= (file->s->state.key_map ==
|
||||||
|
@ -260,7 +260,15 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
|
|||||||
thd->proc_info="update";
|
thd->proc_info="update";
|
||||||
if (duplic != DUP_ERROR)
|
if (duplic != DUP_ERROR)
|
||||||
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
|
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
|
||||||
if (lock_type != TL_WRITE_DELAYED && values_list.elements != 1);
|
/*
|
||||||
|
let's *try* to start bulk inserts. It won't necessary
|
||||||
|
start them as values_list.elements should be greater than
|
||||||
|
some - handler dependent - threshold.
|
||||||
|
So we call start_bulk_insert to perform nesessary checks on
|
||||||
|
values_list.elements, and - if nothing else - to initialize
|
||||||
|
the code to make the call of end_bulk_insert() below safe.
|
||||||
|
*/
|
||||||
|
if (lock_type != TL_WRITE_DELAYED)
|
||||||
table->file->start_bulk_insert(values_list.elements);
|
table->file->start_bulk_insert(values_list.elements);
|
||||||
|
|
||||||
while ((values= its++))
|
while ((values= its++))
|
||||||
|
Reference in New Issue
Block a user