mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-32475 Add logging of test_if_skip_sort_order to optimizer trace
This commit is contained in:
@ -468,6 +468,9 @@ select * from v2 {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"test_if_skip_sort_order": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -796,6 +799,9 @@ explain select * from v1 {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"test_if_skip_sort_order": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -1290,6 +1296,9 @@ EXPLAIN SELECT DISTINCT a FROM t1 {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"test_if_skip_sort_order": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -1484,6 +1493,8 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"test_if_skip_sort_order": [
|
||||||
{
|
{
|
||||||
"reconsidering_access_paths_for_index_ordering": {
|
"reconsidering_access_paths_for_index_ordering": {
|
||||||
"clause": "GROUP BY",
|
"clause": "GROUP BY",
|
||||||
@ -1505,6 +1516,8 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"join_execution": {
|
"join_execution": {
|
||||||
@ -1686,6 +1699,8 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"test_if_skip_sort_order": [
|
||||||
{
|
{
|
||||||
"reconsidering_access_paths_for_index_ordering": {
|
"reconsidering_access_paths_for_index_ordering": {
|
||||||
"clause": "GROUP BY",
|
"clause": "GROUP BY",
|
||||||
@ -1707,6 +1722,8 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"join_execution": {
|
"join_execution": {
|
||||||
@ -1877,6 +1894,8 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"test_if_skip_sort_order": [
|
||||||
{
|
{
|
||||||
"reconsidering_access_paths_for_index_ordering": {
|
"reconsidering_access_paths_for_index_ordering": {
|
||||||
"clause": "GROUP BY",
|
"clause": "GROUP BY",
|
||||||
@ -1898,6 +1917,8 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"join_execution": {
|
"join_execution": {
|
||||||
@ -2175,6 +2196,8 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"test_if_skip_sort_order": [
|
||||||
{
|
{
|
||||||
"reconsidering_access_paths_for_index_ordering": {
|
"reconsidering_access_paths_for_index_ordering": {
|
||||||
"clause": "ORDER BY",
|
"clause": "ORDER BY",
|
||||||
@ -2270,6 +2293,8 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"join_execution": {
|
"join_execution": {
|
||||||
|
@ -23608,8 +23608,12 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
|
|||||||
bool orig_cond_saved= false;
|
bool orig_cond_saved= false;
|
||||||
int best_key= -1;
|
int best_key= -1;
|
||||||
bool changed_key= false;
|
bool changed_key= false;
|
||||||
|
THD *thd= tab->join->thd;
|
||||||
DBUG_ENTER("test_if_skip_sort_order");
|
DBUG_ENTER("test_if_skip_sort_order");
|
||||||
|
|
||||||
|
Json_writer_object trace_wrapper(thd);
|
||||||
|
Json_writer_array trace_arr(thd, "test_if_skip_sort_order");
|
||||||
|
|
||||||
/* Check that we are always called with first non-const table */
|
/* Check that we are always called with first non-const table */
|
||||||
DBUG_ASSERT(tab == tab->join->join_tab + tab->join->const_tables);
|
DBUG_ASSERT(tab == tab->join->join_tab + tab->join->const_tables);
|
||||||
|
|
||||||
@ -23618,6 +23622,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
|
|||||||
tab->type == JT_CONST ||
|
tab->type == JT_CONST ||
|
||||||
tab->type == JT_SYSTEM)
|
tab->type == JT_SYSTEM)
|
||||||
{
|
{
|
||||||
|
Json_writer_object trace_skip(thd);
|
||||||
|
trace_skip.add("skipped", "single row access method");
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user