Details
Description
create table t1 (a int); |
insert into t1 values (1),(2),(3); |
 |
create table t2 (a int); |
insert into t2 values (10),(11); |
analyze format=json
|
select * from (select a from t1 union all select a from t2) TBL; |
Shows something like this:
"table": {
|
"table_name": "<derived2>",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"rows": 5,
|
"r_rows": 5,
|
"r_table_time_ms": 0.039263025,
|
"r_other_time_ms": 0.028563309,
|
"filtered": 100,
|
"r_filtered": 100,
|
"materialized": {
|
"query_block": {
|
"union_result": {
|
"table_name": "<union2,3>",
|
"access_type": "ALL",
|
"r_loops": 0,
|
"r_rows": null,
|
note r_loops=0, r_rows:null. This is clearly incorrect.
Note that regular UNION (not UNION ALL) one gets correct result:
"materialized": {
|
"query_block": {
|
"union_result": {
|
"table_name": "<union2,3>",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"r_rows": 5,
|