mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
This is first cset for WL#1394 "Optimize index merge when all involved index ranges include only values with equal keys"
The main idea is to exploit the fact that key scans for "key=const" return ordered sequences of rowids. include/my_base.h: Added HA_EXTRA_KEYREAD_PRESERVE_FIELDS flag include/my_bitmap.h: Added a couple of utility functions include/my_sys.h: Added my_conunt_bits_ushort function innobase/include/row0mysql.h: Added support for HA_EXTRA_KEYREAD_PRESERVE_FIELDS innobase/row/row0sel.c: Added support for HA_EXTRA_KEYREAD_PRESERVE_FIELDS mysys/my_bit.c: Added my_count_bits_ushort function mysys/my_bitmap.c: Added a couple of utility functions sql/ha_berkeley.cc: Added cmp_ref rowid comparison function. sql/ha_berkeley.h: Added cmp_ref rowid comparison function. sql/ha_heap.h: Added cmp_ref rowid comparison function. sql/ha_innodb.cc: Added cmp_ref rowid comparison function and support from HA_EXTRA_KEYREAD_PRESERVE_FIELDS sql/ha_innodb.h: Added cmp_ref rowid comparison function. sql/handler.h: Added cmp_ref rowid comparison function. sql/opt_range.cc: Added QUICK_ROR_{INTERSECT,UNION}_SELECT classes and related optimizer code sql/opt_range.h: Added QUICK_ROR_{INTERSECT,UNION}_SELECT classes sql/sql_delete.cc: Changed to use new ROWID comparison function also always call quick->reset() for quick selects sql/sql_select.cc: Account for new quick select types sql/sql_select.h: New, proper rowid ordering/comparison function to be used with Unique class etc. sql/sql_test.cc: Account for new quick select types sql/sql_update.cc: Account for new quick select types
This commit is contained in:
@ -182,37 +182,8 @@ TEST_join(JOIN *join)
|
||||
tab->select->quick_keys.print(buf));
|
||||
else if (tab->select->quick)
|
||||
{
|
||||
int quick_type= tab->select->quick->get_type();
|
||||
if ((quick_type == QUICK_SELECT_I::QS_TYPE_RANGE) ||
|
||||
(quick_type == QUICK_SELECT_I::QS_TYPE_RANGE_DESC))
|
||||
{
|
||||
fprintf(DBUG_FILE,
|
||||
" quick select used on key %s, length: %d\n",
|
||||
form->key_info[tab->select->quick->index].name,
|
||||
tab->select->quick->max_used_key_length);
|
||||
}
|
||||
else if (quick_type == QUICK_SELECT_I::QS_TYPE_INDEX_MERGE)
|
||||
{
|
||||
QUICK_INDEX_MERGE_SELECT *quick_imerge=
|
||||
(QUICK_INDEX_MERGE_SELECT*)tab->select->quick;
|
||||
QUICK_RANGE_SELECT *quick;
|
||||
fprintf(DBUG_FILE,
|
||||
" index_merge quick select used\n");
|
||||
|
||||
List_iterator_fast<QUICK_RANGE_SELECT> it(quick_imerge->quick_selects);
|
||||
while ((quick = it++))
|
||||
{
|
||||
fprintf(DBUG_FILE,
|
||||
" range quick select: key %s, length: %d\n",
|
||||
form->key_info[quick->index].name,
|
||||
quick->max_used_key_length);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(DBUG_FILE,
|
||||
" quick select of unknown nature used\n");
|
||||
}
|
||||
fprintf(DBUG_FILE, " quick select used:\n");
|
||||
tab->select->quick->dbug_dump(18, false);
|
||||
}
|
||||
else
|
||||
VOID(fputs(" select used\n",DBUG_FILE));
|
||||
|
Reference in New Issue
Block a user