mirror of
https://github.com/MariaDB/server.git
synced 2025-07-20 10:24:14 +03:00
MDEV-10844: EXPLAIN FORMAT=JSON doesn't show order direction for filesort
Currently explain format=json does not show the order direction of fields used during filesort. This patch would remove this limitation
This commit is contained in:
@ -1582,3 +1582,63 @@ EXPLAIN
|
||||
}
|
||||
}
|
||||
drop table t0,t1;
|
||||
#
|
||||
# MDEV-10844: EXPLAIN FORMAT=JSON doesn't show order direction for filesort
|
||||
#
|
||||
create table t1 (a int, b int);
|
||||
insert into t1 values (1,2),(3,4),(2,3);
|
||||
explain format=json select * from t1 order by a, b desc;
|
||||
EXPLAIN
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"read_sorted_file": {
|
||||
"filesort": {
|
||||
"sort_key": "t1.a, t1.b desc",
|
||||
"table": {
|
||||
"table_name": "t1",
|
||||
"access_type": "ALL",
|
||||
"rows": 3,
|
||||
"filtered": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
explain format=json select * from t1 order by a desc, b desc;
|
||||
EXPLAIN
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"read_sorted_file": {
|
||||
"filesort": {
|
||||
"sort_key": "t1.a desc, t1.b desc",
|
||||
"table": {
|
||||
"table_name": "t1",
|
||||
"access_type": "ALL",
|
||||
"rows": 3,
|
||||
"filtered": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
explain format=json select * from t1 order by a desc, b ;
|
||||
EXPLAIN
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"read_sorted_file": {
|
||||
"filesort": {
|
||||
"sort_key": "t1.a desc, t1.b",
|
||||
"table": {
|
||||
"table_name": "t1",
|
||||
"access_type": "ALL",
|
||||
"rows": 3,
|
||||
"filtered": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user