mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-32475: Skip sorting if we will read one row
test_if_skip_sort_order() should catch the join types JT_EQ_REF, JT_CONST and JT_SYSTEM and skip sort order for these. Such join types imply retrieving of a single row of data, and sorting of a single row can always be skipped.
This commit is contained in:
@ -23613,6 +23613,14 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
|
||||
/* Check that we are always called with first non-const table */
|
||||
DBUG_ASSERT(tab == tab->join->join_tab + tab->join->const_tables);
|
||||
|
||||
/* Sorting a single row can always be skipped */
|
||||
if (tab->type == JT_EQ_REF ||
|
||||
tab->type == JT_CONST ||
|
||||
tab->type == JT_SYSTEM)
|
||||
{
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
/*
|
||||
Keys disabled by ALTER TABLE ... DISABLE KEYS should have already
|
||||
been taken into account.
|
||||
|
Reference in New Issue
Block a user