1103
Preload pages of the index file for a table into the key cache.
1106
int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
1111
TABLE_LIST *table_list= table->pos_in_table_list;
1112
my_bool ignore_leaves= table_list->ignore_leaves;
1113
char buf[ERRMSGSIZE+20];
1115
DBUG_ENTER("ha_myisam::preload_keys");
1117
table->keys_in_use_for_query.clear_all();
1119
if (table_list->process_index_hints(table))
1120
DBUG_RETURN(HA_ADMIN_FAILED);
1123
/* Check validity of the index references */
1124
if (!table->keys_in_use_for_query.is_clear_all())
1125
/* use all keys if there's no list specified by the user through hints */
1126
map= table->keys_in_use_for_query.to_ulonglong();
1128
mi_extra(file, HA_EXTRA_PRELOAD_BUFFER_SIZE,
1129
(void *) &thd->variables.preload_buff_size);
1131
if ((error= mi_preload(file, map, ignore_leaves)))
1134
case HA_ERR_NON_UNIQUE_BLOCK_SIZE:
1135
errmsg= "Indexes use different block sizes";
1137
case HA_ERR_OUT_OF_MEM:
1138
errmsg= "Failed to allocate buffer";
1141
my_snprintf(buf, ERRMSGSIZE,
1142
"Failed to read from index file (errno: %d)", my_errno);
1145
error= HA_ADMIN_FAILED;
1149
DBUG_RETURN(HA_ADMIN_OK);
1154
myisamchk_init(¶m);
1156
param.op_name= "preload_keys";
1157
param.db_name= table->s->db.str;
1158
param.table_name= table->s->table_name.str;
1160
mi_check_print_error(¶m, errmsg);
1167
1103
Disable indexes, making it persistent if requested.