Details
Description
(I tried on 10.6 and 10.10 but perhaps earlier versions are affected as well)
Put this into mysql-test/suite/federated/a1.test :
--source have_federatedx.inc
|
--source include/federated.inc
|
|
connection default; |
|
set global federated_pushdown=1; |
|
connection slave; |
|
DROP TABLE IF EXISTS federated.t1; |
CREATE TABLE federated.t1 ( |
a int(20) NOT NULL |
);
|
INSERT INTO federated.t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); |
|
connection master; |
|
DROP TABLE IF EXISTS federated.t1; |
|
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
eval
|
CREATE TABLE federated.t1 ( |
a int(20) NOT NULL |
)
|
ENGINE="FEDERATED" CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; |
|
analyze format=json
|
select * from (select * from federated.t1 where a<3 union |
select * from federated.t1 where a>=3) T; |
|
set global federated_pushdown=0; |
|
source include/federated_cleanup.inc;
|
and run.
At the end of output see:
{
|
"query_block": {
|
"select_id": 1,
|
"r_loops": 1,
|
"r_total_time_ms": 0.548587957,
|
"table": {
|
"table_name": "<derived2>",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"rows": 20,
|
"r_rows": 0,
|
"r_table_time_ms": 1.660416e-4,
|
"r_other_time_ms": 0.005957995,
|
"filtered": 100,
|
"r_filtered": 100,
|
"materialized": {
|
"query_block": {
|
"select_id": 2,
|
"table": {
|
"message": "Pushed derived"
|
}
|
}
|
}
|
}
|
}
|
}
|
Note the {{ "r_rows": 0}}.
This is because pushdown code doesn't handle ANALYZE correctly.
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Assignee | Oleg Smirnov [ JIRAUSER50405 ] |
Fix Version/s | 10.6 [ 24028 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Assignee | Oleg Smirnov [ JIRAUSER50405 ] | Sergei Petrunia [ psergey ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Sergei Petrunia [ psergey ] | Oleg Smirnov [ JIRAUSER50405 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Affects Version/s | 10.4 [ 22408 ] | |
Affects Version/s | 10.5 [ 23123 ] |
Fix Version/s | 11.1 [ 28549 ] | |
Fix Version/s | 11.2 [ 28603 ] | |
Fix Version/s | 10.4.31 [ 29010 ] | |
Fix Version/s | 10.5.22 [ 29011 ] | |
Fix Version/s | 10.6.15 [ 29013 ] | |
Fix Version/s | 10.9.8 [ 29015 ] | |
Fix Version/s | 10.10.6 [ 29017 ] | |
Fix Version/s | 10.11.5 [ 29019 ] | |
Fix Version/s | 11.0.3 [ 28920 ] | |
Fix Version/s | 10.6 [ 24028 ] |
Fix Version/s | 11.1.2 [ 28921 ] | |
Fix Version/s | 11.2.1 [ 29034 ] | |
Fix Version/s | 11.1 [ 28549 ] | |
Fix Version/s | 11.2 [ 28603 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
So what is the goal of this task - to display correct "r_rows" or to remove "r_rows" line for pushed down derived tables?
For information, there is almost no analyze data for pushed SELECTs:
analyze format=json select * from federated.t1 where a<3;
ANALYZE
{
"query_block": {
"select_id": 1,
"table": {
"message": "Pushed select"
}
}
}