mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-30032: EXPLAIN FORMAT=JSON output: print costs
Basic printout for join and table execution costs.
This commit is contained in:
@ -927,11 +927,13 @@ drop table t0,t1;
|
||||
create table t0 (a int);
|
||||
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
|
||||
--source include/explain-no-costs.inc
|
||||
explain format=json select rank() over (order by a) from t0;
|
||||
|
||||
create table t1 (a int, b int, c int);
|
||||
insert into t1 select a,a,a from t0;
|
||||
|
||||
--source include/explain-no-costs.inc
|
||||
explain format=json
|
||||
select
|
||||
a,
|
||||
@ -939,6 +941,7 @@ select
|
||||
from t1
|
||||
group by a;
|
||||
|
||||
--source include/explain-no-costs.inc
|
||||
explain format=json
|
||||
select
|
||||
a,
|
||||
@ -952,6 +955,7 @@ order by null;
|
||||
--echo #
|
||||
|
||||
select b,max(a) as MX, rank() over (order by b) from t1 group by b having MX in (3,5,7);
|
||||
--source include/explain-no-costs.inc
|
||||
explain format=json
|
||||
select b,max(a) as MX, rank() over (order by b) from t1 group by b having MX in (3,5,7);
|
||||
|
||||
@ -1040,24 +1044,28 @@ from t1;
|
||||
show status like '%sort%';
|
||||
|
||||
# Check using EXPLAIN FORMAT=JSON
|
||||
--source include/explain-no-costs.inc
|
||||
explain format=json
|
||||
select
|
||||
rank() over (partition by c order by a),
|
||||
rank() over (partition by c order by a)
|
||||
from t1;
|
||||
|
||||
--source include/explain-no-costs.inc
|
||||
explain format=json
|
||||
select
|
||||
rank() over (order by a),
|
||||
row_number() over (order by a)
|
||||
from t1;
|
||||
|
||||
--source include/explain-no-costs.inc
|
||||
explain format=json
|
||||
select
|
||||
rank() over (partition by c order by a),
|
||||
count(*) over (partition by c)
|
||||
from t1;
|
||||
|
||||
--source include/explain-no-costs.inc
|
||||
explain format=json
|
||||
select
|
||||
count(*) over (partition by c),
|
||||
@ -1089,6 +1097,7 @@ insert into t1 values (null,'a');
|
||||
insert into t1 values (2,'b');
|
||||
insert into t1 values (-1,'');
|
||||
|
||||
--source include/explain-no-costs.inc
|
||||
explain format=json
|
||||
select *, row_number() over (order by s1, s2) as X from t1 order by X desc;
|
||||
select *, row_number() over (order by s1, s2) as X from t1 order by X desc;
|
||||
@ -1177,6 +1186,7 @@ insert into t1 values
|
||||
|
||||
select rank() over (partition by part_id order by a) from t1;
|
||||
select distinct rank() over (partition by part_id order by a) from t1;
|
||||
--source include/explain-no-costs.inc
|
||||
explain format=json
|
||||
select distinct rank() over (partition by part_id order by a) from t1;
|
||||
|
||||
@ -1301,6 +1311,7 @@ select pk, a, d,
|
||||
sum(d) over (order by a
|
||||
ROWS BETWEEN 1 preceding and 2 following) as sum_2
|
||||
from t1;
|
||||
--source include/explain-no-costs.inc
|
||||
explain format=json
|
||||
select pk, a, d,
|
||||
sum(d) over (partition by a order by pk
|
||||
@ -1336,6 +1347,7 @@ insert into t1 values
|
||||
(10, 5, 1000),
|
||||
(10, 1, 100);
|
||||
|
||||
--source include/explain-no-costs.inc
|
||||
explain format=json
|
||||
select
|
||||
a,b,c,
|
||||
|
Reference in New Issue
Block a user