mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
ORDER BY index traversal direction in the optimizer trace
This commit is contained in:
@@ -2176,6 +2176,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
|
|||||||
{
|
{
|
||||||
"index": "a_a",
|
"index": "a_a",
|
||||||
"can_resolve_order": true,
|
"can_resolve_order": true,
|
||||||
|
"direction": 1,
|
||||||
"updated_limit": 47,
|
"updated_limit": 47,
|
||||||
"index_scan_time": 47,
|
"index_scan_time": 47,
|
||||||
"usable": false,
|
"usable": false,
|
||||||
@@ -2184,6 +2185,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
|
|||||||
{
|
{
|
||||||
"index": "a_c",
|
"index": "a_c",
|
||||||
"can_resolve_order": true,
|
"can_resolve_order": true,
|
||||||
|
"direction": 1,
|
||||||
"updated_limit": 47,
|
"updated_limit": 47,
|
||||||
"range_scan_time": 4.331020747,
|
"range_scan_time": 4.331020747,
|
||||||
"index_scan_time": 4.331020747,
|
"index_scan_time": 4.331020747,
|
||||||
|
@@ -232,9 +232,7 @@ static bool test_if_cheaper_ordering(const JOIN_TAB *tab,
|
|||||||
ha_rows *new_select_limit,
|
ha_rows *new_select_limit,
|
||||||
uint *new_used_key_parts= NULL,
|
uint *new_used_key_parts= NULL,
|
||||||
uint *saved_best_key_parts= NULL);
|
uint *saved_best_key_parts= NULL);
|
||||||
static int test_if_order_by_key(JOIN *join,
|
static int test_if_order_by_key(JOIN *, ORDER *, TABLE *, uint, uint *);
|
||||||
ORDER *order, TABLE *table, uint idx,
|
|
||||||
uint *used_key_parts);
|
|
||||||
static bool test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,
|
static bool test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,
|
||||||
ha_rows select_limit, bool no_changes,
|
ha_rows select_limit, bool no_changes,
|
||||||
const key_map *map);
|
const key_map *map);
|
||||||
@@ -28967,6 +28965,7 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table,
|
|||||||
DBUG_ASSERT (ref_key != (int) nr);
|
DBUG_ASSERT (ref_key != (int) nr);
|
||||||
|
|
||||||
possible_key.add("can_resolve_order", true);
|
possible_key.add("can_resolve_order", true);
|
||||||
|
possible_key.add("direction", direction);
|
||||||
bool is_covering= (table->covering_keys.is_set(nr) ||
|
bool is_covering= (table->covering_keys.is_set(nr) ||
|
||||||
(table->file->index_flags(nr, 0, 1) &
|
(table->file->index_flags(nr, 0, 1) &
|
||||||
HA_CLUSTERED_INDEX));
|
HA_CLUSTERED_INDEX));
|
||||||
|
Reference in New Issue
Block a user