[MDEV-7836] ANALYZE FORMAT=JSON should provide info about GROUP BY Created: 2015-03-25  Updated: 2023-12-05

Status: Stalled
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.1
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 1
Labels: analyze-stmt

Issue Links:
Relates
relates to MDEV-6995 EXPLAIN JSON and ORDER BY, GROUP BY, etc Open
relates to MDEV-7648 Extra data in ANALYZE FORMAT=JSON $stmt Open
Sprint: 10.1.6-1, 10.1.6-2, 10.1.7-1

 Description   

At the very least, we need to know

  • how many groups we've got
  • whether the heap or myisam table was used.


 Comments   
Comment by Sergei Petrunia [ 2015-04-10 ]

An example that calls JOIN::make_simple_join() twice:

create table t5 (a int , b int) ;
create table t6 like t5 ;
create table t7 like t5 ;
insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7),
                      (2, -1), (3, 10) ;
insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ;
insert into t7 values (3, 3), (2, 2), (1, 1) ;

select count(distinct t5.b) as sum from t5, t6
                     where t5.a=t6.a and t6.b > 0 and t5.a <= 5
                     group by t5.a order by sum limit 1

This executes as follows:

1. create a tmp. table $TMP1 (without any keys)
2. run the join, put its output into $TMP1
3. create a temporary table $TMP2 (without any keys again)
4. use filesort() sort data from $TMP1 (produces an ordered stream)
5. read data from filesort result, do group-by-on-the-fly
and write into $TMP2.
// make_simple_join call.
6. use filesort(), read from $TMP2 and sort
7. read from filesort results and write to output.

Comment by Sergei Petrunia [ 2015-04-12 ]

MDEV-6995 has info about research done for EXPLAIN=JSON on this topic

Comment by Julien Fritsch [ 2023-12-05 ]

Automated message:
----------------------------
Since this issue has not been updated since 6 weeks, it's time to move it back to Stalled.

Generated at Thu Feb 08 07:22:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.