mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Made keyread (key scanning) a key specific attribute.
This avoids using fulltext keys for table scanning. This also reverts Sinisa's original fix for this problem. Docs/manual.texi: Update of SQL_JOIN_MAX_SIZE information3602 client/mysqldump.c: comment cleanup include/my_aes.h: General cleanup for new file include/rijndael.h: General cleanup for new file include/sha1.h: General cleanup for new file mysys/my_aes.c: General cleanup for new file mysys/rijndael.c: General cleanup for new file mysys/sha1.c: General cleanup for new file sql/ha_berkeley.h: Made keyread (key scanning) a key specific attribute. sql/ha_innodb.cc: Merge with 3.23.x sql/ha_innodb.h: Made keyread (key scanning) a key specific attribute. sql/ha_isam.cc: Moved things to table_flags() sql/ha_isam.h: Made keyread (key scanning) a key specific attribute. sql/ha_myisam.cc: Made keyread (key scanning) a key specific attribute. sql/ha_myisam.h: Made keyread (key scanning) a key specific attribute. sql/ha_myisammrg.h: Made keyread (key scanning) a key specific attribute. sql/handler.h: Made keyread (key scanning) a key specific attribute. sql/item_strfunc.cc: Cleanup of AES_xxx code sql/opt_range.cc: Made keyread (key scanning) a key specific attribute. sql/sql_base.cc: Made keyread (key scanning) a key specific attribute. sql/sql_cache.cc: Removed compiler warning sql/sql_select.cc: Removed wrong patch to fulltext problem sql/table.cc: Made keyread (key scanning) a key specific attribute. sql/table.h: Made keyread (key scanning) a key specific attribute.
This commit is contained in:
@ -682,27 +682,27 @@ int SQL_SELECT::test_quick_select(key_map keys_to_use, table_map prev_tables,
|
||||
{
|
||||
ha_rows found_records;
|
||||
double found_read_time;
|
||||
|
||||
if (*key)
|
||||
{
|
||||
uint keynr= param.real_keynr[idx];
|
||||
if ((*key)->type == SEL_ARG::MAYBE_KEY ||
|
||||
(*key)->maybe_flag)
|
||||
needed_reg|= (key_map) 1 << param.real_keynr[idx];
|
||||
needed_reg|= (key_map) 1 << keynr;
|
||||
|
||||
found_records=check_quick_select(¶m,idx, *key);
|
||||
found_records=check_quick_select(¶m, idx, *key);
|
||||
if (found_records != HA_POS_ERROR && found_records > 2 &&
|
||||
head->used_keys & ((table_map) 1 << param.real_keynr[idx]) &&
|
||||
(head->file->table_flags() & HA_HAVE_KEY_READ_ONLY))
|
||||
head->used_keys & ((table_map) 1 << keynr) &&
|
||||
(head->file->index_flags(keynr) & HA_KEY_READ_ONLY))
|
||||
{
|
||||
/*
|
||||
** We can resolve this by only reading through this key
|
||||
** Assume that we will read trough the whole key range
|
||||
** and that all key blocks are half full (normally things are
|
||||
** much better)
|
||||
We can resolve this by only reading through this key.
|
||||
Assume that we will read trough the whole key range
|
||||
and that all key blocks are half full (normally things are
|
||||
much better).
|
||||
*/
|
||||
uint keys_per_block= head->file->block_size/2/
|
||||
(head->key_info[param.real_keynr[idx]].key_length+
|
||||
head->file->ref_length) + 1;
|
||||
uint keys_per_block= (head->file->block_size/2/
|
||||
(head->key_info[keynr].key_length+
|
||||
head->file->ref_length) + 1);
|
||||
found_read_time=((double) (found_records+keys_per_block-1)/
|
||||
(double) keys_per_block);
|
||||
}
|
||||
|
Reference in New Issue
Block a user