Details
-
Bug
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.1(EOL)
-
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.
Attachments
Issue Links
- relates to
-
MDEV-6995 EXPLAIN JSON and ORDER BY, GROUP BY, etc
-
- Open
-
-
MDEV-7648 Extra data in ANALYZE FORMAT=JSON $stmt
-
- Open
-
-
MDEV-30660 Aggregation functions fail to leverage uniqueness property
-
- Closed
-
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.