[FEAT MERGE]4_1_sql_feature

Co-authored-by: leslieyuchen <leslieyuchen@gmail.com>
Co-authored-by: Charles0429 <xiezhenjiang@gmail.com>
Co-authored-by: raywill <hustos@gmail.com>
This commit is contained in:
obdev
2023-01-28 16:01:26 +08:00
committed by ob-robot
parent 3080f2b66f
commit 2d19a9d8f5
846 changed files with 161957 additions and 116661 deletions

View File

@ -6,75 +6,111 @@ ERROR HY000: unmatched parentheses in regular expression
select * from t1 where a regexp 'a(b';
ERROR HY000: unmatched parentheses in regular expression
select * from t1 where a regexp '*';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 1.' from regexp
select * from t1 where a regexp '+';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 1.' from regexp
select * from t1 where a regexp '?';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 1.' from regexp
select * from t1 where a regexp '(*a)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 2.' from regexp
select * from t1 where a regexp '(+a)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 2.' from regexp
select * from t1 where a regexp '(?a)';
ERROR HY000: invalid embedded option in regular expression
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where a regexp '({1}a)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 2.' from regexp
select * from t1 where a regexp '(a|*b)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 4.' from regexp
select * from t1 where a regexp '(a|+b)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 4.' from regexp
select * from t1 where a regexp '(a|?b)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 4.' from regexp
select * from t1 where a regexp '(a|{1}b)';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 4.' from regexp
select * from t1 where a regexp '^*';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
hello 0
test 0
select * from t1 where a regexp '^+';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
hello 0
test 0
select * from t1 where a regexp '^?';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
hello 0
test 0
select * from t1 where a regexp '^{1}';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
hello 0
test 0
select * from t1 where a regexp '{1';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 1.' from regexp
select * from t1 where a regexp '{1}';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 1.' from regexp
select * from t1 where a regexp 'a{1';
ERROR HY000: braces {} not balanced in in regular expression
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where a regexp 'a{1a';
ERROR HY000: invalid repetition count(s) in regular expression
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where a regexp 'a{1a}';
ERROR HY000: invalid repetition count(s) in regular expression
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where a regexp 'a{1,x}';
ERROR HY000: invalid repetition count(s) in regular expression
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where a regexp 'a{1,x';
ERROR HY000: invalid repetition count(s) in regular expression
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where a regexp 'a{300}';
ERROR HY000: invalid repetition count(s) in regular expression
a b
select * from t1 where a regexp 'a{1,0}';
ERROR HY000: invalid repetition count(s) in regular expression
ERROR 42000: Got error 'U_REGEX_MAX_LT_MIN' from regexp
select * from t1 where a regexp 'a++';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
select * from t1 where a regexp 'a*+';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
hello 0
test 0
select * from t1 where a regexp 'a+*';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where a regexp 'a?*';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where a regexp 'a?+';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
hello 0
test 0
select * from t1 where a regexp 'a{1}{1}';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 5.' from regexp
select * from t1 where a regexp 'a*{1}';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where a regexp 'a+{1}';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where a regexp 'a?{1}';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where a regexp 'a{1}*';
ERROR HY000: The regular expression was too complex and current library can't be parsed
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 5.' from regexp
select * from t1 where a regexp 'a{1}+';
ERROR HY000: The regular expression was too complex and current library can't be parsed
a b
a 0
abc 0
abcd 0
drop table t1;
drop table if exists t1;
create table t1 (a datetime primary key);
@ -1367,11 +1403,9 @@ id name
524 abcd
573 ab
select * from t1 where name regexp 'a{,2}';
id name
299 a{,2}
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where name regexp 'a{,}';
id name
301 a{,}
ERROR 42000: Got error 'U_REGEX_BAD_INTERVAL' from regexp
select * from t1 where name regexp 'ab{0,0}c';
id name
311 abcac
@ -1732,8 +1766,7 @@ id name
567 A1
573 ab
select * from t1 where name regexp 'a*{b}';
id name
344 a{b}
ERROR 42000: Got error 'U_REGEX_RULE_SYNTAX, Syntax error in regular expression on line 1, character 3.' from regexp
select * from t1 where name regexp '[[:alnum:]]+';
id name
1 hello
@ -6287,3 +6320,11 @@ insert into t values ('');
select c1 regexp 'ddd' from t;
c1 regexp 'ddd'
0
drop table if exists t1;
create table t1(c1 blob);
insert into t1 values('UNPRESS123');
insert into t1 values('UNPRESS456');
select * from t1 where c1 regexp '^U';
c1
UNPRESS123
UNPRESS456

View File

@ -1,8 +1,7 @@
--disable_query_log
set @@session.explicit_defaults_for_timestamp=off;
--enable_query_log
# owner: guoyun.lgy
# modifier: jiangxiu.wt
# owner: jiangxiu.wt
# owner group: SQL1
# description: regexp的测试
@ -19,75 +18,75 @@ insert into t1 (a) values ('a'),('abc'),('abcd'),('hello'),('test');
select * from t1 where a regexp 'a(';
--error 5813
select * from t1 where a regexp 'a(b';
--error 5820
--error 1139
select * from t1 where a regexp '*';
--error 5820
--error 1139
select * from t1 where a regexp '+';
--error 5820
--error 1139
select * from t1 where a regexp '?';
--error 5820
--error 1139
select * from t1 where a regexp '(*a)';
--error 5820
--error 1139
select * from t1 where a regexp '(+a)';
--error 5824
--error 1139
select * from t1 where a regexp '(?a)';
--error 5820
--error 1139
select * from t1 where a regexp '({1}a)';
--error 5820
--error 1139
select * from t1 where a regexp '(a|*b)';
--error 5820
--error 1139
select * from t1 where a regexp '(a|+b)';
--error 5820
--error 1139
select * from t1 where a regexp '(a|?b)';
--error 5820
--error 1139
select * from t1 where a regexp '(a|{1}b)';
--error 5820
select * from t1 where a regexp '^*';
--error 5820
select * from t1 where a regexp '^+';
--error 5820
select * from t1 where a regexp '^?';
--error 5820
select * from t1 where a regexp '^{1}';
--error 5820
--error 1139
select * from t1 where a regexp '{1';
--error 5820
--error 1139
select * from t1 where a regexp '{1}';
--error 5818
--error 1139
select * from t1 where a regexp 'a{1';
--error 5819
--error 1139
select * from t1 where a regexp 'a{1a';
--error 5819
--error 1139
select * from t1 where a regexp 'a{1a}';
--error 5819
--error 1139
select * from t1 where a regexp 'a{1,x}';
--error 5819
--error 1139
select * from t1 where a regexp 'a{1,x';
--error 5819
select * from t1 where a regexp 'a{300}';
--error 5819
--error 1139
select * from t1 where a regexp 'a{1,0}';
--error 5820
select * from t1 where a regexp 'a++';
--error 5820
select * from t1 where a regexp 'a*+';
--error 5820
--error 1139
select * from t1 where a regexp 'a+*';
--error 5820
--error 1139
select * from t1 where a regexp 'a?*';
--error 5820
select * from t1 where a regexp 'a?+';
--error 5820
--error 1139
select * from t1 where a regexp 'a{1}{1}';
--error 5820
--error 1139
select * from t1 where a regexp 'a*{1}';
--error 5820
--error 1139
select * from t1 where a regexp 'a+{1}';
--error 5820
--error 1139
select * from t1 where a regexp 'a?{1}';
--error 5820
--error 1139
select * from t1 where a regexp 'a{1}*';
--error 5820
select * from t1 where a regexp 'a{1}+';
drop table t1;
@ -280,7 +279,9 @@ select * from t1 where name regexp 'ab?c';
select * from t1 where name regexp 'a{1}b';
select * from t1 where name regexp 'a{1,}b';
select * from t1 where name regexp 'a{1,2}b';
--error 1139
select * from t1 where name regexp 'a{,2}';
--error 1139
select * from t1 where name regexp 'a{,}';
select * from t1 where name regexp 'ab{0,0}c';
select * from t1 where name regexp 'ab{0,1}c';
@ -290,6 +291,7 @@ select * from t1 where name regexp 'ab{1,3}c';
select * from t1 where name regexp 'ab{2,2}c';
select * from t1 where name regexp 'ab{2,4}c';
select * from t1 where name regexp '((a{1,10}){1,10}){1,10}';
--error 1139
select * from t1 where name regexp 'a*{b}';
select * from t1 where name regexp '[[:alnum:]]+';
select * from t1 where name regexp '[[:alpha:]]+';
@ -443,3 +445,13 @@ drop table if exists t;
create table t (c1 char(20));
insert into t values ('');
select c1 regexp 'ddd' from t;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1(c1 blob);
insert into t1 values('UNPRESS123');
insert into t1 values('UNPRESS456');
select * from t1 where c1 regexp '^U';

View File

@ -134,12 +134,12 @@ group_concat(distinct c2, c3 order by 2 desc, 1 asc)
abc,abc,a1b3,a2b3,a3b2
select group_concat(c2, c3) from t1 group by c5;
group_concat(c2, c3)
a2b3,a1b3,a3b2
a2b3,a3b2,a1b3
abc,abc
select group_concat(distinct c2, c3) from t1 group by c5;
group_concat(distinct c2, c3)
abc,abc
a1b3,a2b3,a3b2
abc,abc
select group_concat(c2, c3 order by c1) from t1 group by c5;
group_concat(c2, c3 order by c1)
a2b3,a1b3,a3b2
@ -170,16 +170,16 @@ a1b3,a2b3,a3b2
abc,abc
select min(c2), max(c3), count(*), count(c1), avg(c4), group_concat(distinct c2, c3 order by 2 desc, 1 asc) from t1 group by c5;
min(c2) max(c3) count(*) count(c1) avg(c4) group_concat(distinct c2, c3 order by 2 desc, 1 asc)
a c 2 2 21.5000 abc,abc
a1 b3 3 3 24.3333 a1b3,a2b3,a3b2
a c 2 2 21.5000 abc,abc
select group_concat(c3, c4 order by c4 desc) from t1 group by c5;
group_concat(c3, c4 order by c4 desc)
b225,b324,b324
c22,bc21
select group_concat(distinct c3, c4 order by c4 desc) from t1 group by c5;
group_concat(distinct c3, c4 order by c4 desc)
c22,bc21
b225,b324
c22,bc21
select group_concat(c4 order by 1 desc) from t1 group by c5;
group_concat(c4 order by 1 desc)
22,21
@ -194,16 +194,16 @@ group_concat(distinct c4 order by c4 desc separator 'AAA')
25AAA24
select group_concat(distinct c4 order by 1 desc separator '#') from t1 group by c5;
group_concat(distinct c4 order by 1 desc separator '#')
22#21
25#24
22#21
select group_concat(distinct c2, c3 order by c3 asc, c2 desc separator '%%') from t1 group by c5;
group_concat(distinct c2, c3 order by c3 asc, c2 desc separator '%%')
abc%%abc
a3b2%%a2b3%%a1b3
abc%%abc
select group_concat(c2, c3 order by c4 desc separator '*') from t1 group by c5;
group_concat(c2, c3 order by c4 desc separator '*')
abc*abc
a3b2*a2b3*a1b3
abc*abc
select group_concat(c2 separator '\\') from t1;
group_concat(c2 separator '\\')
a\ab\a2\a1\a3
@ -226,7 +226,7 @@ select group_concat(c2) from t2 group by c4;
group_concat(c2)
NULL
d1,d2,d4
d1,d4,d2
d5
select @@group_concat_max_len;
@@group_concat_max_len
@ -244,7 +244,7 @@ select group_concat(c2) from t2 group by c4;
group_concat(c2)
NULL
d1,d2,d
d1,d4,d
d5
Warnings:
Warning 1260 Row 3 was cut by GROUP_CONCAT()
@ -284,7 +284,7 @@ select group_concat(c2) from t2 group by c4;
group_concat(c2)
NULL
d1,d2,d4
d1,d4,d2
d5
select group_concat(c2, c3) from t2 group by c4;
group_concat(c2, c3)
@ -360,15 +360,15 @@ insert into t1 (c1, c2, c3) values (2, 3, 2);
insert into t1 (c1, c2, c3) values (2, 3, 3);
select c2, avg(distinct c3) from t1 group by c2;
c2 avg(distinct c3)
1 1.5000
2 2.5000
1 1.5000
3 2.5000
select c1,c2, group_concat(distinct c3 order by c3 desc) from t1 group by c1,c2;
c1 c2 group_concat(distinct c3 order by c3 desc)
1 1 1
1 2 3,2
2 1 2
2 3 3,2
2 1 2
1 2 3,2
select c1,c2, group_concat(distinct c3 order by c3 desc) from t1 group by c1,c2 with rollup;
c1 c2 group_concat(distinct c3 order by c3 desc)
1 1 1

View File

@ -244,6 +244,7 @@ _enable_oracle_priv_check
_enable_parallel_minor_merge
_enable_partition_level_retry
_enable_plan_cache_mem_diagnosis
_enable_protocol_diagnose
_enable_px_batch_rescan
_enable_px_bloom_filter_sync
_enable_px_ordered_coord
@ -286,6 +287,8 @@ _private_buffer_size
_pushdown_storage_level
_px_bloom_filter_group_size
_px_chunklist_count_ratio
_px_join_skew_handling
_px_join_skew_minfreq
_px_max_message_pool_pct
_px_max_pipeline_depth
_px_message_compression

View File

@ -216,6 +216,16 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr
412 __all_service_epoch 0 201001 1
413 __all_spatial_reference_systems 0 201001 1
416 __all_column_checksum_error_info 0 201001 1
433 __all_rls_policy 0 201001 1
434 __all_rls_policy_history 0 201001 1
435 __all_rls_security_column 0 201001 1
436 __all_rls_security_column_history 0 201001 1
437 __all_rls_group 0 201001 1
438 __all_rls_group_history 0 201001 1
439 __all_rls_context 0 201001 1
440 __all_rls_context_history 0 201001 1
441 __all_rls_attribute 0 201001 1
442 __all_rls_attribute_history 0 201001 1
443 __all_tenant_rewrite_rules 0 201001 1
444 __all_reserved_snapshot 0 201001 1
445 __all_cluster_event_history 0 201001 1
@ -262,7 +272,7 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr
11036 __all_virtual_core_column_table 2 201001 1
11037 __all_virtual_memory_info 2 201001 1
11039 __all_virtual_sys_parameter_stat 2 201001 1
11042 __all_virtual_trace_log 2 201001 1
11042 __all_virtual_trace_span_info 2 201001 1
11043 __all_virtual_engine 2 201001 1
11045 __all_virtual_proxy_server_stat 2 201001 1
11046 __all_virtual_proxy_sys_variable 2 201001 1
@ -380,7 +390,6 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr
12121 __all_virtual_raid_stat 2 201001 1
12123 __all_virtual_dtl_channel 2 201001 1
12124 __all_virtual_dtl_memory 2 201001 1
12125 __all_virtual_dtl_first_cached_buffer 2 201001 1
12126 __all_virtual_dblink 2 201001 1
12127 __all_virtual_dblink_history 2 201001 1
12129 __all_virtual_tenant_role_grantee_map 2 201001 1
@ -550,7 +559,21 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr
12336 __all_virtual_schema_memory 2 201001 1
12337 __all_virtual_schema_slot 2 201001 1
12338 __all_virtual_minor_freeze_info 2 201001 1
12339 __all_virtual_show_trace 2 201001 1
12340 __all_virtual_ha_diagnose 2 201001 1
12348 __all_virtual_rls_policy 2 201001 1
12349 __all_virtual_rls_policy_history 2 201001 1
12350 __all_virtual_rls_security_column 2 201001 1
12351 __all_virtual_rls_security_column_history 2 201001 1
12352 __all_virtual_rls_group 2 201001 1
12353 __all_virtual_rls_group_history 2 201001 1
12354 __all_virtual_rls_context 2 201001 1
12355 __all_virtual_rls_context_history 2 201001 1
12356 __all_virtual_rls_attribute 2 201001 1
12357 __all_virtual_rls_attribute_history 2 201001 1
12359 __all_virtual_sql_plan 2 201001 1
12360 __all_virtual_plan_table 2 201001 1
12361 __all_virtual_plan_real_info 2 201001 1
12362 __all_virtual_core_table 2 201001 1
20001 GV$OB_PLAN_CACHE_STAT 1 201001 1
20002 GV$OB_PLAN_CACHE_PLAN_STAT 1 201001 1
@ -818,6 +841,10 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr
21338 DBA_OB_DATABASE_PRIVILEGE 1 201001 1
21339 CDB_OB_DATABASE_PRIVILEGE 1 201001 1
21340 DBA_OB_USER_DEFINED_RULES 1 201001 1
21341 GV$OB_SQL_PLAN 1 201001 1
21342 V$OB_SQL_PLAN 1 201001 1
21343 GV$OB_PLAN_REAL_INFO 1 201001 1
21344 V$OB_PLAN_REAL_INFO 1 201001 1
21345 DBA_OB_CLUSTER_EVENT_HISTORY 1 201001 1
21346 PARAMETERS 1 201002 1
21347 TABLE_PRIVILEGES 1 201002 1

View File

@ -17,23 +17,28 @@ insert/*trace*/ into t1(id) values (107);
insert/*trace*/ into t2(id) values (107),(75),(1000);
EXPLAIN select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id>200;
Query Plan
====================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|t1 |1 |2 |
|2 | TABLE SCAN|t2 |1 |2 |
====================================
Outputs & filters:
===========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-------------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|t1 |1 |2 |
|2 | TABLE SCAN|t2 |1 |2 |
===========================================
Outputs & filters:
-------------------------------------
0 - output([t1.id], [t2.id]), filter(nil), rowset=256,
0 - output([t1.id], [t2.id]), filter(nil), rowset=256
equal_conds([t2.id = t1.id]), other_conds(nil)
1 - output([t1.id]), filter(nil), rowset=256,
merge_directions([ASC])
1 - output([t1.id]), filter(nil), rowset=256
access([t1.id]), partitions(p0)
2 - output([t2.id]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([t1.id]), range(200 ; MAX),
range_cond([t1.id > 200])
2 - output([t2.id]), filter(nil), rowset=256
access([t2.id]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.id]), range(200 ; MAX),
range_cond([t2.id > 200])
select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id>200;
+----+----+
| id | id |
@ -42,23 +47,28 @@ select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id>200;
EXPLAIN select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id>200 and t1.id<200;
Query Plan
====================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|t1 |1 |2 |
|2 | TABLE SCAN|t2 |1 |2 |
====================================
Outputs & filters:
===========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-------------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|t1 |1 |2 |
|2 | TABLE SCAN|t2 |1 |2 |
===========================================
Outputs & filters:
-------------------------------------
0 - output([t1.id], [t2.id]), filter(nil), rowset=256,
0 - output([t1.id], [t2.id]), filter(nil), rowset=256
equal_conds([t2.id = t1.id]), other_conds(nil)
1 - output([t1.id]), filter(nil), rowset=256,
merge_directions([ASC])
1 - output([t1.id]), filter(nil), rowset=256
access([t1.id]), partitions(p0)
2 - output([t2.id]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([t1.id]), range(MAX ; MIN)always false,
range_cond([t1.id > 200], [t1.id < 200])
2 - output([t2.id]), filter(nil), rowset=256
access([t2.id]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.id]), range(200 ; MAX),
range_cond([t2.id > 200])
select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id>200 and t1.id<200;
+----+----+
| id | id |
@ -67,23 +77,28 @@ select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id>200 and t1.id<200;
EXPLAIN select a.id , b.id from t1 a, t2 b where a.id = b.id and a.id>200 and a.id<200;
Query Plan
====================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|a |1 |2 |
|2 | TABLE SCAN|b |1 |2 |
====================================
Outputs & filters:
===========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-------------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|a |1 |2 |
|2 | TABLE SCAN|b |1 |2 |
===========================================
Outputs & filters:
-------------------------------------
0 - output([a.id], [b.id]), filter(nil), rowset=256,
0 - output([a.id], [b.id]), filter(nil), rowset=256
equal_conds([a.id = b.id]), other_conds(nil)
1 - output([a.id]), filter(nil), rowset=256,
merge_directions([ASC])
1 - output([a.id]), filter(nil), rowset=256
access([a.id]), partitions(p0)
2 - output([b.id]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([a.id]), range(MAX ; MIN)always false,
range_cond([a.id > 200], [a.id < 200])
2 - output([b.id]), filter(nil), rowset=256
access([b.id]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([b.id]), range(200 ; MAX),
range_cond([b.id > 200])
select a.id , b.id from t1 a, t2 b where a.id = b.id and a.id>200 and a.id<200;
+----+----+
| id | id |
@ -92,25 +107,28 @@ select a.id , b.id from t1 a, t2 b where a.id = b.id and a.id>200 and a.id<200;
EXPLAIN select a.id, b.id from t1 a, t2 b where a.id = a.id and a.id>200 and a.id<200;
Query Plan
===================================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
---------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN| |3 |4 |
|1 | TABLE SCAN |b |3 |2 |
|2 | MATERIAL | |1 |2 |
|3 | TABLE SCAN |a |1 |2 |
===================================================
Outputs & filters:
===========================================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN | |3 |4 |
|1 | TABLE SCAN |b |3 |2 |
|2 | MATERIAL | |1 |2 |
|3 | TABLE SCAN |a |1 |2 |
===========================================================
Outputs & filters:
-------------------------------------
0 - output([a.id], [b.id]), filter(nil), rowset=256,
conds(nil), nl_params_(nil)
1 - output([b.id]), filter(nil), rowset=256,
0 - output([a.id], [b.id]), filter(nil), rowset=256
conds(nil), nl_params_(nil), batch_join=false
1 - output([b.id]), filter(nil), rowset=256
access([b.id]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([b.id]), range(MIN ; MAX)always true
2 - output([a.id]), filter(nil), rowset=256
3 - output([a.id]), filter([a.id = a.id]), rowset=256,
3 - output([a.id]), filter([a.id = a.id]), rowset=256
access([a.id]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.id]), range(MAX ; MIN)always false,
range_cond([a.id > 200], [a.id < 200])
select a.id, b.id from t1 a, t2 b where a.id = a.id and a.id>200 and a.id<200;
+----+----+
| id | id |

View File

@ -19,23 +19,28 @@ insert/*trace*/ into t2(id) values (107),(75),(1000);
EXPLAIN select t1.id, t2.id from t1 join t2 on t2.id = t1.id and t1.id>200;
Query Plan
====================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|t1 |1 |2 |
|2 | TABLE SCAN|t2 |1 |2 |
====================================
Outputs & filters:
===========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-------------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|t1 |1 |2 |
|2 | TABLE SCAN|t2 |1 |2 |
===========================================
Outputs & filters:
-------------------------------------
0 - output([t1.id], [t2.id]), filter(nil), rowset=256,
0 - output([t1.id], [t2.id]), filter(nil), rowset=256
equal_conds([t2.id = t1.id]), other_conds(nil)
1 - output([t1.id]), filter(nil), rowset=256,
merge_directions([ASC])
1 - output([t1.id]), filter(nil), rowset=256
access([t1.id]), partitions(p0)
2 - output([t2.id]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([t1.id]), range(200 ; MAX),
range_cond([t1.id > 200])
2 - output([t2.id]), filter(nil), rowset=256
access([t2.id]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.id]), range(200 ; MAX),
range_cond([t2.id > 200])
select t1.id, t2.id from t1 join t2 on t2.id = t1.id and t1.id>200;
+----+----+
| id | id |
@ -44,23 +49,28 @@ select t1.id, t2.id from t1 join t2 on t2.id = t1.id and t1.id>200;
EXPLAIN select t1.id, t2.id from t1 join t2 on t2.id = t1.id and t1.id>200 and t1.id<200;
Query Plan
====================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|t1 |1 |2 |
|2 | TABLE SCAN|t2 |1 |2 |
====================================
Outputs & filters:
===========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-------------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|t1 |1 |2 |
|2 | TABLE SCAN|t2 |1 |2 |
===========================================
Outputs & filters:
-------------------------------------
0 - output([t1.id], [t2.id]), filter(nil), rowset=256,
0 - output([t1.id], [t2.id]), filter(nil), rowset=256
equal_conds([t2.id = t1.id]), other_conds(nil)
1 - output([t1.id]), filter(nil), rowset=256,
merge_directions([ASC])
1 - output([t1.id]), filter(nil), rowset=256
access([t1.id]), partitions(p0)
2 - output([t2.id]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([t1.id]), range(MAX ; MIN)always false,
range_cond([t1.id > 200], [t1.id < 200])
2 - output([t2.id]), filter(nil), rowset=256
access([t2.id]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.id]), range(200 ; MAX),
range_cond([t2.id > 200])
select t1.id, t2.id from t1 join t2 on t2.id = t1.id and t1.id>200 and t1.id<200;
+----+----+
| id | id |
@ -69,23 +79,28 @@ select t1.id, t2.id from t1 join t2 on t2.id = t1.id and t1.id>200 and t1.id<200
EXPLAIN select a.id , b.id from t1 a join t2 b on a.id = b.id and a.id>200 and a.id<200;
Query Plan
====================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|a |1 |2 |
|2 | TABLE SCAN|b |1 |2 |
====================================
Outputs & filters:
===========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-------------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|a |1 |2 |
|2 | TABLE SCAN|b |1 |2 |
===========================================
Outputs & filters:
-------------------------------------
0 - output([a.id], [b.id]), filter(nil), rowset=256,
0 - output([a.id], [b.id]), filter(nil), rowset=256
equal_conds([a.id = b.id]), other_conds(nil)
1 - output([a.id]), filter(nil), rowset=256,
merge_directions([ASC])
1 - output([a.id]), filter(nil), rowset=256
access([a.id]), partitions(p0)
2 - output([b.id]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([a.id]), range(MAX ; MIN)always false,
range_cond([a.id > 200], [a.id < 200])
2 - output([b.id]), filter(nil), rowset=256
access([b.id]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([b.id]), range(200 ; MAX),
range_cond([b.id > 200])
select a.id , b.id from t1 a join t2 b on a.id = b.id and a.id>200 and a.id<200;
+----+----+
| id | id |
@ -94,25 +109,28 @@ select a.id , b.id from t1 a join t2 b on a.id = b.id and a.id>200 and a.id<200;
EXPLAIN select a.id, b.id from t1 a join t2 b on a.id = a.id and a.id>200 and a.id<200;
Query Plan
===================================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
---------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN| |3 |4 |
|1 | TABLE SCAN |b |3 |2 |
|2 | MATERIAL | |1 |2 |
|3 | TABLE SCAN |a |1 |2 |
===================================================
Outputs & filters:
===========================================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN | |3 |4 |
|1 | TABLE SCAN |b |3 |2 |
|2 | MATERIAL | |1 |2 |
|3 | TABLE SCAN |a |1 |2 |
===========================================================
Outputs & filters:
-------------------------------------
0 - output([a.id], [b.id]), filter(nil), rowset=256,
conds(nil), nl_params_(nil)
1 - output([b.id]), filter(nil), rowset=256,
0 - output([a.id], [b.id]), filter(nil), rowset=256
conds(nil), nl_params_(nil), batch_join=false
1 - output([b.id]), filter(nil), rowset=256
access([b.id]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([b.id]), range(MIN ; MAX)always true
2 - output([a.id]), filter(nil), rowset=256
3 - output([a.id]), filter([a.id = a.id]), rowset=256,
3 - output([a.id]), filter([a.id = a.id]), rowset=256
access([a.id]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.id]), range(MAX ; MIN)always false,
range_cond([a.id > 200], [a.id < 200])
select a.id, b.id from t1 a join t2 b on a.id = a.id and a.id>200 and a.id<200;
+----+----+
| id | id |

View File

@ -19,23 +19,28 @@ insert/*trace*/ into t2(id) values (107),(75),(1000);
EXPLAIN select t1.id, t2.id from t1 join t2 on t2.id = t1.id where t1.id>200;
Query Plan
====================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|t1 |1 |2 |
|2 | TABLE SCAN|t2 |1 |2 |
====================================
Outputs & filters:
===========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-------------------------------------------
|0 |MERGE JOIN | |1 |4 |
|1 | TABLE SCAN|t1 |1 |2 |
|2 | TABLE SCAN|t2 |1 |2 |
===========================================
Outputs & filters:
-------------------------------------
0 - output([t1.id], [t2.id]), filter(nil), rowset=256,
0 - output([t1.id], [t2.id]), filter(nil), rowset=256
equal_conds([t2.id = t1.id]), other_conds(nil)
1 - output([t1.id]), filter(nil), rowset=256,
merge_directions([ASC])
1 - output([t1.id]), filter(nil), rowset=256
access([t1.id]), partitions(p0)
2 - output([t2.id]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([t1.id]), range(200 ; MAX),
range_cond([t1.id > 200])
2 - output([t2.id]), filter(nil), rowset=256
access([t2.id]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.id]), range(200 ; MAX),
range_cond([t2.id > 200])
select t1.id, t2.id from t1 join t2 on t2.id = t1.id where t1.id>200;
+----+----+
| id | id |
@ -44,23 +49,28 @@ select t1.id, t2.id from t1 join t2 on t2.id = t1.id where t1.id>200;
EXPLAIN select t1.id, t2.id from t1 join t2 on t2.id = t1.id where t1.id>200 and t1.id<200;
Query Plan
====================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
------------------------------------
|0 |MERGE JOIN | |2 |4 |
|1 | TABLE SCAN|t1 |1 |2 |
|2 | TABLE SCAN|t2 |2 |2 |
====================================
Outputs & filters:
===========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-------------------------------------------
|0 |MERGE JOIN | |2 |4 |
|1 | TABLE SCAN|t1 |1 |2 |
|2 | TABLE SCAN|t2 |2 |2 |
===========================================
Outputs & filters:
-------------------------------------
0 - output([t1.id], [t2.id]), filter(nil), rowset=256,
0 - output([t1.id], [t2.id]), filter(nil), rowset=256
equal_conds([t2.id = t1.id]), other_conds(nil)
1 - output([t1.id]), filter(nil), rowset=256,
merge_directions([ASC])
1 - output([t1.id]), filter(nil), rowset=256
access([t1.id]), partitions(p0)
2 - output([t2.id]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([t1.id]), range(200 ; MAX),
range_cond([t1.id > 200])
2 - output([t2.id]), filter(nil), rowset=256
access([t2.id]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.id]), range(NULL ; 200),
range_cond([t2.id < 200])
select t1.id, t2.id from t1 join t2 on t2.id = t1.id where t1.id>200 and t1.id<200;
+----+----+
| id | id |
@ -69,23 +79,28 @@ select t1.id, t2.id from t1 join t2 on t2.id = t1.id where t1.id>200 and t1.id<2
EXPLAIN select a.id , b.id from t1 a join t2 b on a.id = b.id where a.id>200 and a.id<200;
Query Plan
====================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
------------------------------------
|0 |MERGE JOIN | |2 |4 |
|1 | TABLE SCAN|a |1 |2 |
|2 | TABLE SCAN|b |2 |2 |
====================================
Outputs & filters:
===========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-------------------------------------------
|0 |MERGE JOIN | |2 |4 |
|1 | TABLE SCAN|a |1 |2 |
|2 | TABLE SCAN|b |2 |2 |
===========================================
Outputs & filters:
-------------------------------------
0 - output([a.id], [b.id]), filter(nil), rowset=256,
0 - output([a.id], [b.id]), filter(nil), rowset=256
equal_conds([a.id = b.id]), other_conds(nil)
1 - output([a.id]), filter(nil), rowset=256,
merge_directions([ASC])
1 - output([a.id]), filter(nil), rowset=256
access([a.id]), partitions(p0)
2 - output([b.id]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([a.id]), range(200 ; MAX),
range_cond([a.id > 200])
2 - output([b.id]), filter(nil), rowset=256
access([b.id]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([b.id]), range(NULL ; 200),
range_cond([b.id < 200])
select a.id , b.id from t1 a join t2 b on a.id = b.id where a.id>200 and a.id<200;
+----+----+
| id | id |
@ -94,25 +109,28 @@ select a.id , b.id from t1 a join t2 b on a.id = b.id where a.id>200 and a.id<20
EXPLAIN select a.id , b.id from t1 a join t2 b on a.id = a.id where a.id>200 and a.id<200;
Query Plan
===================================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
---------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN| |3 |4 |
|1 | TABLE SCAN |b |3 |2 |
|2 | MATERIAL | |1 |2 |
|3 | TABLE SCAN |a |1 |2 |
===================================================
Outputs & filters:
===========================================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN | |3 |4 |
|1 | TABLE SCAN |b |3 |2 |
|2 | MATERIAL | |1 |2 |
|3 | TABLE SCAN |a |1 |2 |
===========================================================
Outputs & filters:
-------------------------------------
0 - output([a.id], [b.id]), filter(nil), rowset=256,
conds(nil), nl_params_(nil)
1 - output([b.id]), filter(nil), rowset=256,
0 - output([a.id], [b.id]), filter(nil), rowset=256
conds(nil), nl_params_(nil), batch_join=false
1 - output([b.id]), filter(nil), rowset=256
access([b.id]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([b.id]), range(MIN ; MAX)always true
2 - output([a.id]), filter(nil), rowset=256
3 - output([a.id]), filter([a.id = a.id]), rowset=256,
3 - output([a.id]), filter([a.id = a.id]), rowset=256
access([a.id]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.id]), range(MAX ; MIN)always false,
range_cond([a.id > 200], [a.id < 200])
select a.id , b.id from t1 a join t2 b on a.id = a.id where a.id>200 and a.id<200;
+----+----+
| id | id |

View File

@ -21,361 +21,385 @@ index k4(c1,c2,c3,c4),
index k5(c1,c2,c3,c4,c5));
explain select count(*) from t1;
Query Plan
==========================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
------------------------------------------
|0 |SCALAR GROUP BY| |1 |2 |
|1 | TABLE SCAN |t1(k1)|1 |2 |
==========================================
Outputs & filters:
=================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-------------------------------------------------
|0 |SCALAR GROUP BY| |1 |2 |
|1 | TABLE SCAN |t1(k1)|1 |2 |
=================================================
Outputs & filters:
-------------------------------------
0 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256,
0 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256
group(nil), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
1 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256,
1 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256
access(nil), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.__pk_increment]), range(MIN,MIN ; MAX,MAX)always true
explain select * from t1 where c1 = 1;
Query Plan
=====================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------
|0 |TABLE SCAN|t1(k1)|1 |5 |
============================================
Outputs & filters:
-------------------------------------
|0 |TABLE SCAN|t1(k1)|1 |5 |
=====================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256
access([t1.__pk_increment], [t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
is_index_back=true, is_global_index=false,
range_key([t1.c1], [t1.__pk_increment]), range(1,MIN ; 1,MAX),
range_cond([t1.c1 = 1])
explain select * from t1 where c1 < 1;
Query Plan
=====================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------
|0 |TABLE SCAN|t1(k1)|1 |5 |
============================================
Outputs & filters:
-------------------------------------
|0 |TABLE SCAN|t1(k1)|1 |5 |
=====================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256
access([t1.__pk_increment], [t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
is_index_back=true, is_global_index=false,
range_key([t1.c1], [t1.__pk_increment]), range(NULL,MAX ; 1,MIN),
range_cond([t1.c1 < 1])
explain select * from t1 where c1 > 1;
Query Plan
=====================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------
|0 |TABLE SCAN|t1(k1)|1 |5 |
============================================
Outputs & filters:
-------------------------------------
|0 |TABLE SCAN|t1(k1)|1 |5 |
=====================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256
access([t1.__pk_increment], [t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
is_index_back=true, is_global_index=false,
range_key([t1.c1], [t1.__pk_increment]), range(1,MAX ; MAX,MAX),
range_cond([t1.c1 > 1])
explain select * from t1 where c1 > 1 and c1 < 10;
Query Plan
=====================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------
|0 |TABLE SCAN|t1(k1)|1 |5 |
============================================
Outputs & filters:
-------------------------------------
|0 |TABLE SCAN|t1(k1)|1 |5 |
=====================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256
access([t1.__pk_increment], [t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
is_index_back=true, is_global_index=false,
range_key([t1.c1], [t1.__pk_increment]), range(1,MAX ; 10,MIN),
range_cond([t1.c1 > 1], [t1.c1 < 10])
explain select * from t1 where c1 = 1 and c2 < 1;
Query Plan
=====================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------
|0 |TABLE SCAN|t1(k2)|1 |5 |
============================================
Outputs & filters:
-------------------------------------
|0 |TABLE SCAN|t1(k2)|1 |5 |
=====================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256
access([t1.__pk_increment], [t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
is_index_back=true, is_global_index=false,
range_key([t1.c1], [t1.c2], [t1.__pk_increment]), range(1,NULL,MAX ; 1,1,MIN),
range_cond([t1.c1 = 1], [t1.c2 < 1])
explain select * from t1 where c1 = 1 and c2 = 1;
Query Plan
=====================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------
|0 |TABLE SCAN|t1(k2)|1 |5 |
============================================
Outputs & filters:
-------------------------------------
|0 |TABLE SCAN|t1(k2)|1 |5 |
=====================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256
access([t1.__pk_increment], [t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
is_index_back=true, is_global_index=false,
range_key([t1.c1], [t1.c2], [t1.__pk_increment]), range(1,1,MIN ; 1,1,MAX),
range_cond([t1.c1 = 1], [t1.c2 = 1])
explain select * from t1 where c1 = 1 and c2 = 1 and c3 < 1;
Query Plan
=====================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------
|0 |TABLE SCAN|t1(k3)|1 |5 |
============================================
Outputs & filters:
-------------------------------------
|0 |TABLE SCAN|t1(k3)|1 |5 |
=====================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256
access([t1.__pk_increment], [t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
is_index_back=true, is_global_index=false,
range_key([t1.c1], [t1.c2], [t1.c3], [t1.__pk_increment]), range(1,1,NULL,MAX ; 1,1,1,MIN),
range_cond([t1.c1 = 1], [t1.c2 = 1], [t1.c3 < 1])
explain select * from t1 where c1 = 1 and c2 = 1 and c3 = 1;
Query Plan
=====================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------
|0 |TABLE SCAN|t1(k3)|1 |5 |
============================================
Outputs & filters:
-------------------------------------
|0 |TABLE SCAN|t1(k3)|1 |5 |
=====================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), filter(nil), rowset=256
access([t1.__pk_increment], [t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10]), partitions(p0)
is_index_back=true, is_global_index=false,
range_key([t1.c1], [t1.c2], [t1.c3], [t1.__pk_increment]), range(1,1,1,MIN ; 1,1,1,MAX),
range_cond([t1.c1 = 1], [t1.c2 = 1], [t1.c3 = 1])
explain select count(*) from t2;
Query Plan
==========================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
------------------------------------------
|0 |SCALAR GROUP BY| |1 |2 |
|1 | TABLE SCAN |t2(k1)|1 |2 |
==========================================
Outputs & filters:
=================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-------------------------------------------------
|0 |SCALAR GROUP BY| |1 |2 |
|1 | TABLE SCAN |t2(k1)|1 |2 |
=================================================
Outputs & filters:
-------------------------------------
0 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256,
0 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256
group(nil), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
1 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256,
1 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256
access(nil), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.c1], [t2.c6], [t2.c7]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
explain select * from t2 where c1 = 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil), rowset=256,
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil), rowset=256
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.c1], [t2.c6], [t2.c7]), range(1,MIN,MIN ; 1,MAX,MAX),
range_cond([t2.c1 = 1])
explain select * from t2 where c1 < 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil), rowset=256,
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil), rowset=256
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.c1], [t2.c6], [t2.c7]), range(NULL,MAX,MAX ; 1,MIN,MIN),
range_cond([t2.c1 < 1])
explain select * from t2 where c1 > 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil), rowset=256,
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil), rowset=256
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.c1], [t2.c6], [t2.c7]), range(1,MAX,MAX ; MAX,MAX,MAX),
range_cond([t2.c1 > 1])
explain select * from t2 where c1 > 1 and c1 < 10;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil), rowset=256,
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter(nil), rowset=256
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.c1], [t2.c6], [t2.c7]), range(1,MAX,MAX ; 10,MIN,MIN),
range_cond([t2.c1 > 1], [t2.c1 < 10])
explain select * from t2 where c1 = 1 and c2 < 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter([t2.c2 < 1]), rowset=256,
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter([t2.c2 < 1]), rowset=256
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([t2.c1], [t2.c6], [t2.c7]), range(1,MIN,MIN ; 1,MAX,MAX),
range_cond([t2.c1 = 1])
explain select * from t2 where c1 = 1 and c2 = 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter([t2.c2 = 1]), rowset=256,
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter([t2.c2 = 1]), rowset=256
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([t2.c1], [t2.c6], [t2.c7]), range(1,MIN,MIN ; 1,MAX,MAX),
range_cond([t2.c1 = 1])
explain select * from t2 where c1 = 1 and c2 = 1 and c3 < 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter([t2.c3 < 1], [t2.c2 = 1]), rowset=256,
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter([t2.c3 < 1], [t2.c2 = 1]), rowset=256
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false,false],
range_key([t2.c1], [t2.c6], [t2.c7]), range(1,MIN,MIN ; 1,MAX,MAX),
range_cond([t2.c1 = 1])
explain select * from t2 where c1 = 1 and c2 = 1 and c3 = 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t2 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter([t2.c2 = 1], [t2.c3 = 1]), rowset=256,
0 - output([t2.c1], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c6], [t2.c7], [t2.c8], [t2.c9], [t2.c10]), filter([t2.c2 = 1], [t2.c3 = 1]), rowset=256
access([t2.c1], [t2.c6], [t2.c7], [t2.c2], [t2.c3], [t2.c4], [t2.c5], [t2.c8], [t2.c9], [t2.c10]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false,false],
range_key([t2.c1], [t2.c6], [t2.c7]), range(1,MIN,MIN ; 1,MAX,MAX),
range_cond([t2.c1 = 1])
explain select count(*) from t3;
Query Plan
==========================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
------------------------------------------
|0 |SCALAR GROUP BY| |1 |2 |
|1 | TABLE SCAN |t3(k1)|1 |2 |
==========================================
Outputs & filters:
=================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-------------------------------------------------
|0 |SCALAR GROUP BY| |1 |2 |
|1 | TABLE SCAN |t3(k1)|1 |2 |
=================================================
Outputs & filters:
-------------------------------------
0 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256,
0 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256
group(nil), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
1 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256,
1 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256
access(nil), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t3.c1], [t3.c2], [t3.c6]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
explain select * from t3 where c1 = 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256,
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t3.c1], [t3.c2], [t3.c6]), range(1,MIN,MIN ; 1,MAX,MAX),
range_cond([t3.c1 = 1])
explain select * from t3 where c1 < 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256,
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t3.c1], [t3.c2], [t3.c6]), range(NULL,MAX,MAX ; 1,MIN,MIN),
range_cond([t3.c1 < 1])
explain select * from t3 where c1 > 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256,
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t3.c1], [t3.c2], [t3.c6]), range(1,MAX,MAX ; MAX,MAX,MAX),
range_cond([t3.c1 > 1])
explain select * from t3 where c1 > 1 and c1 < 10;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256,
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t3.c1], [t3.c2], [t3.c6]), range(1,MAX,MAX ; 10,MIN,MIN),
range_cond([t3.c1 > 1], [t3.c1 < 10])
explain select * from t3 where c1 = 1 and c2 < 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256,
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t3.c1], [t3.c2], [t3.c6]), range(1,NULL,MAX ; 1,1,MIN),
range_cond([t3.c1 = 1], [t3.c2 < 1])
explain select * from t3 where c1 = 1 and c2 = 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256,
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter(nil), rowset=256
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t3.c1], [t3.c2], [t3.c6]), range(1,1,MIN ; 1,1,MAX),
range_cond([t3.c1 = 1], [t3.c2 = 1])
explain select * from t3 where c1 = 1 and c2 = 1 and c3 < 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter([t3.c3 < 1]), rowset=256,
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter([t3.c3 < 1]), rowset=256
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([t3.c1], [t3.c2], [t3.c6]), range(1,1,MIN ; 1,1,MAX),
range_cond([t3.c1 = 1], [t3.c2 = 1])
explain select * from t3 where c1 = 1 and c2 = 1 and c3 = 1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t3 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter([t3.c3 = 1]), rowset=256,
0 - output([t3.c1], [t3.c2], [t3.c3], [t3.c4], [t3.c5], [t3.c6], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), filter([t3.c3 = 1]), rowset=256
access([t3.c1], [t3.c2], [t3.c6], [t3.c3], [t3.c4], [t3.c5], [t3.c7], [t3.c8], [t3.c9], [t3.c10]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([t3.c1], [t3.c2], [t3.c6]), range(1,1,MIN ; 1,1,MAX),
range_cond([t3.c1 = 1], [t3.c2 = 1])

View File

@ -848,7 +848,6 @@ drop function chistics|
set @@sql_mode=@old_mode|
insert into t1 values ("foo", 1), ("bar", 2), ("zip", 3)|
set @@sql_mode = 'ANSI'|
ERROR 0A000: Not supported feature or function
drop procedure if exists modes$
create procedure modes(out c1 int, out c2 int)
begin
@ -871,11 +870,11 @@ set @@sql_mode = ''|
set sql_select_limit = 1|
call modes(@c1, @c2)|
c1 c2
1 3
12 3
set sql_select_limit = default|
select @c1, @c2|
@c1 @c2
1 3
12 3
delete from t1|
drop procedure modes|
create database sp_db1|
@ -2225,7 +2224,6 @@ drop function if exists bug2564_3$
create function bug2564_3(x int, y int) returns int
return x || y$
set @@sql_mode = 'ANSI'$
ERROR 0A000: Not supported feature or function
drop function if exists bug2564_4$
create function bug2564_4(x int, y int) returns int
return x || y$
@ -2246,7 +2244,7 @@ bug2564_3 CREATE DEFINER = admin@% FUNCTION `test`.`bug2564_3`
) RETURNS int(11) return x || y utf8mb4 utf8mb4_general_ci utf8mb4_general_ci
show create function bug2564_4|
Function sql_mode Create Function character_set_client collation_connection Database Collation
bug2564_4 CREATE DEFINER = admin@% FUNCTION `test`.`bug2564_4`
bug2564_4 REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI CREATE DEFINER = admin@% FUNCTION `test`.`bug2564_4`
(
`x` int(11), `y` int(11)
) RETURNS int(11) return x || y utf8mb4 utf8mb4_general_ci utf8mb4_general_ci
@ -3634,7 +3632,6 @@ drop procedure if exists bug6127|
create table t3 (s1 int unique)|
set @sm=@@sql_mode|
set sql_mode='traditional'|
ERROR 0A000: Not supported feature or function
create procedure bug6127()
begin
declare continue handler for sqlstate '23000'
@ -3650,13 +3647,13 @@ call bug6127()|
select * from t3|
s1
1
2147483647
0
call bug6127()|
ERROR 23000: Duplicate entry '2147483647' for key 's1'
ERROR 23000: Duplicate entry '0' for key 's1'
select * from t3|
s1
1
2147483647
0
set sql_mode=@sm|
drop table t3|
drop procedure bug6127|
@ -5418,7 +5415,6 @@ create function pi() returns varchar(50)
return "pie, my favorite desert.";
SET @save_sql_mode=@@sql_mode;
SET SQL_MODE='IGNORE_SPACE';
ERROR 0A000: Not supported feature or function
select pi(), pi ();
pi() pi ()
3.141593 3.141593
@ -5444,7 +5440,6 @@ use nowhere;
drop database nowhere;
SET @save_sql_mode=@@sql_mode;
SET SQL_MODE='IGNORE_SPACE';
ERROR 0A000: Not supported feature or function
select database(), database ();
database() database ()
NULL NULL
@ -5475,7 +5470,6 @@ return "Stored function current_user";
create function md5(x varchar(50)) returns varchar(50)
return "Stored function md5";
SET SQL_MODE='IGNORE_SPACE';
ERROR 0A000: Not supported feature or function
select database(), database ();
database() database ()
test test

View File

@ -1021,7 +1021,6 @@ set @@sql_mode=@old_mode|
# Check mode settings
insert into t1 values ("foo", 1), ("bar", 2), ("zip", 3)|
--error 1235
set @@sql_mode = 'ANSI'|
delimiter $|
--disable_warnings ONCE
@ -2607,7 +2606,6 @@ drop function if exists bug2564_3$
create function bug2564_3(x int, y int) returns int
return x || y$
--error 1235
set @@sql_mode = 'ANSI'$
--disable_warnings ONCE
drop function if exists bug2564_4$
@ -4429,7 +4427,6 @@ drop procedure if exists bug6127|
create table t3 (s1 int unique)|
set @sm=@@sql_mode|
--error 1235
set sql_mode='traditional'|
create procedure bug6127()
@ -6556,7 +6553,6 @@ return "pie, my favorite desert.";
SET @save_sql_mode=@@sql_mode;
--error 1235
SET SQL_MODE='IGNORE_SPACE';
select pi(), pi ();
@ -6596,7 +6592,6 @@ drop database nowhere;
SET @save_sql_mode=@@sql_mode;
--error 1235
SET SQL_MODE='IGNORE_SPACE';
select database(), database ();
@ -6625,7 +6620,6 @@ return "Stored function current_user";
create function md5(x varchar(50)) returns varchar(50)
return "Stored function md5";
--error 1235
SET SQL_MODE='IGNORE_SPACE';
select database(), database ();

View File

@ -24,22 +24,27 @@ Query Plan
|7 | PX BLOCK ITERATOR | |
|8 | TABLE SCAN |t2 |
===========================================
Outputs & filters:
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(t1.c1, 1, t2.c1, 1)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, 1, t2.c1, 1)]), filter(nil), rowset=256, dop=3
2 - output([t1.c1], [t2.c1]), filter(nil), rowset=256,
1 - output([INTERNAL_FUNCTION(t1.c1, 1, t2.c1, 1)]), filter(nil), rowset=256
dop=3
2 - output([t1.c1], [t2.c1]), filter(nil), rowset=256
equal_conds([t1.c1 = t2.c1]), other_conds(nil)
3 - output([t1.c1]), filter(nil), rowset=256
4 - output([t1.c1]), filter(nil), rowset=256,
affinitize
4 - output([t1.c1]), filter(nil), rowset=256
access([t1.c1]), partitions(p[0-9])
is_index_back=false, is_global_index=false,
range_key([t1.c1]), range(MIN ; MAX)always true
5 - output([t2.c1]), filter(nil), rowset=256
6 - (#keys=1, [t2.c1]), output([t2.c1]), filter(nil), rowset=256, dop=3
6 - output([t2.c1]), filter(nil), rowset=256
(#keys=1, [t2.c1]), dop=3
7 - output([t2.c1]), filter(nil), rowset=256
8 - output([t2.c1]), filter(nil), rowset=256,
8 - output([t2.c1]), filter(nil), rowset=256
access([t2.c1]), partitions(p[0-5])
is_index_back=false, is_global_index=false,
range_key([t2.c1]), range(MIN ; MAX)always true
select /*+ USE_PX parallel(3) */* from
(select c1,count(*) over(partition by c1) c2 from
(select c1,count(c2) c2 from t1 group by c1)c) a join
@ -76,29 +81,35 @@ Query Plan
|12| PX PARTITION HASH JOIN-FILTER|:BF0000 |
|13| TABLE SCAN |a |
==================================================
Outputs & filters:
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(a.c2, T_FUN_COUNT_SUM(T_FUN_COUNT(*)))]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(a.c2, T_FUN_COUNT_SUM(T_FUN_COUNT(*)))]), filter(nil), rowset=256, dop=3
2 - output([a.c2], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256,
1 - output([INTERNAL_FUNCTION(a.c2, T_FUN_COUNT_SUM(T_FUN_COUNT(*)))]), filter(nil), rowset=256
dop=3
2 - output([a.c2], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256
group([a.c2]), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
3 - output([a.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256
4 - (#keys=1, [a.c2]), output([a.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256, dop=3
5 - output([a.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256,
4 - output([a.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256
(#keys=1, [a.c2]), dop=3
5 - output([a.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256
group([a.c2]), agg_func([T_FUN_COUNT(*)])
6 - output([a.c2]), filter(nil), rowset=256,
6 - output([a.c2]), filter(nil), rowset=256
equal_conds([a.c1 = b.c1]), other_conds(nil)
7 - output([b.c1]), filter(nil), rowset=256
8 - output([b.c1]), filter(nil), rowset=256
9 - (#keys=1, [b.c1]), output([b.c1]), filter(nil), rowset=256, dop=3
10 - output([b.c1]), filter(nil), rowset=256
11 - output([b.c1]), filter(nil), rowset=256,
9 - output([b.c1]), filter(nil), rowset=256
(#keys=1, [b.c1]), dop=3
10 - output([b.c1]), filter(nil), rowset=256
11 - output([b.c1]), filter(nil), rowset=256
access([b.c1]), partitions(p[0-5])
12 - output([a.c1], [a.c2]), filter(nil), rowset=256
13 - output([a.c1], [a.c2], [PARTITION_ID]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([b.c1]), range(MIN ; MAX)always true
12 - output([a.c1], [a.c2]), filter(nil), rowset=256
affinitize
13 - output([a.c1], [a.c2], [PARTITION_ID]), filter(nil), rowset=256
access([a.c1], [a.c2]), partitions(p[0-9])
is_index_back=false, is_global_index=false,
range_key([a.c1]), range(MIN ; MAX)always true
select a.c2,count(*) from (select /*+ USE_PX parallel(3) PQ_DISTRIBUTE(b HASH HASH) */a.c1,a.c2,b.c1 c3,b.c2 c4 from t1 a join t2 b on a.c1=b.c1)a group by a.c2;
c2 count(*)
1 1

View File

@ -3,162 +3,186 @@ create table t1 (c1 int, c2 int, c3 int);
create table t2 (c1 int, c2 int, c3 int);
explain select /*+ use_px parallel(2) use_hash(c d) */ * from (select a.c2, b.c3 from (select /*+ use_hash(a, b) */ c1, c2, count(*) c3 from t1 group by 1, 2) a, (select c1, c2, count(*) c3 from t1 group by 1, 2) b where a.c1 = b.c1) c, (select c1, c2, count(*) c3 from t1 group by 1, 2) d where c.c2 = d.c2;
Query Plan
=====================================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
---------------------------------------------------------------------
|0 |TEMP TABLE TRANSFORMATION | |1 |5 |
|1 | PX COORDINATOR | |1 |4 |
|2 | EXCHANGE OUT DISTR |:EX10001 |1 |4 |
|3 | TEMP TABLE INSERT |TEMP1 |1 |3 |
|4 | HASH GROUP BY | |1 |3 |
|5 | EXCHANGE IN DISTR | |2 |3 |
|6 | EXCHANGE OUT DISTR (HASH) |:EX10000 |2 |3 |
|7 | HASH GROUP BY | |2 |2 |
|8 | PX BLOCK ITERATOR | |1 |1 |
|9 | TABLE SCAN |t1 |1 |1 |
|10| PX COORDINATOR | |1 |2 |
|11| EXCHANGE OUT DISTR |:EX20002 |1 |2 |
|12| SHARED HASH JOIN | |1 |1 |
|13| EXCHANGE IN DISTR | |1 |1 |
|14| EXCHANGE OUT DISTR (BC2HOST) |:EX20001 |1 |1 |
|15| SHARED HASH JOIN | |1 |1 |
|16| EXCHANGE IN DISTR | |1 |1 |
|17| EXCHANGE OUT DISTR (BC2HOST)|:EX20000 |1 |1 |
|18| TEMP TABLE ACCESS |VIEW2(TEMP1)|1 |1 |
|19| TEMP TABLE ACCESS |VIEW3(TEMP1)|1 |1 |
|20| TEMP TABLE ACCESS |VIEW1(TEMP1)|1 |1 |
=====================================================================
Outputs & filters:
============================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
----------------------------------------------------------------------------
|0 |TEMP TABLE TRANSFORMATION | |1 |5 |
|1 | PX COORDINATOR | |1 |4 |
|2 | EXCHANGE OUT DISTR |:EX10001 |1 |4 |
|3 | TEMP TABLE INSERT |TEMP1 |1 |3 |
|4 | HASH GROUP BY | |1 |3 |
|5 | EXCHANGE IN DISTR | |2 |3 |
|6 | EXCHANGE OUT DISTR (HASH) |:EX10000 |2 |3 |
|7 | HASH GROUP BY | |2 |2 |
|8 | PX BLOCK ITERATOR | |1 |1 |
|9 | TABLE SCAN |t1 |1 |1 |
|10| PX COORDINATOR | |1 |2 |
|11| EXCHANGE OUT DISTR |:EX20002 |1 |2 |
|12| SHARED HASH JOIN | |1 |1 |
|13| EXCHANGE IN DISTR | |1 |1 |
|14| EXCHANGE OUT DISTR (BC2HOST) |:EX20001 |1 |1 |
|15| SHARED HASH JOIN | |1 |1 |
|16| EXCHANGE IN DISTR | |1 |1 |
|17| EXCHANGE OUT DISTR (BC2HOST)|:EX20000 |1 |1 |
|18| TEMP TABLE ACCESS |VIEW2(TEMP1)|1 |1 |
|19| TEMP TABLE ACCESS |VIEW3(TEMP1)|1 |1 |
|20| TEMP TABLE ACCESS |VIEW1(TEMP1)|1 |1 |
============================================================================
Outputs & filters:
-------------------------------------
0 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)], [VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256
1 - output(nil), filter(nil), rowset=256
2 - output(nil), filter(nil), rowset=256, dop=2
2 - output(nil), filter(nil), rowset=256
dop=2
3 - output(nil), filter(nil), rowset=256
4 - output([t1.c1], [t1.c2], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256,
4 - output([t1.c1], [t1.c2], [T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256
group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
5 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256
6 - (#keys=2, [t1.c1], [t1.c2]), output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256, dop=2
7 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256,
6 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256
(#keys=2, [t1.c1], [t1.c2]), dop=2
7 - output([t1.c1], [t1.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256
group([t1.c1], [t1.c2]), agg_func([T_FUN_COUNT(*)])
8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256
9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256,
9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256
access([t1.c1], [t1.c2]), partitions(p0)
10 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)], [VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256
11 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)], [VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256, dop=2
12 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)], [VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
10 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)], [VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256
11 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)], [VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256
dop=2
12 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)], [VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256
equal_conds([VIEW2.t1.c2 = VIEW1.t1.c2]), other_conds(nil)
13 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)]), filter(nil), rowset=256
14 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)]), filter(nil), rowset=256, dop=2
15 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)]), filter(nil), rowset=256,
13 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)]), filter(nil), rowset=256
14 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)]), filter(nil), rowset=256
dop=2
15 - output([VIEW2.t1.c2], [VIEW3.T_FUN_COUNT(*)]), filter(nil), rowset=256
equal_conds([VIEW2.t1.c1 = VIEW3.t1.c1]), other_conds(nil)
16 - output([VIEW2.t1.c2], [VIEW2.t1.c1]), filter(nil), rowset=256
17 - output([VIEW2.t1.c2], [VIEW2.t1.c1]), filter(nil), rowset=256, dop=2
18 - output([VIEW2.t1.c1], [VIEW2.t1.c2]), filter(nil), rowset=256,
16 - output([VIEW2.t1.c2], [VIEW2.t1.c1]), filter(nil), rowset=256
17 - output([VIEW2.t1.c2], [VIEW2.t1.c1]), filter(nil), rowset=256
dop=2
18 - output([VIEW2.t1.c1], [VIEW2.t1.c2]), filter(nil), rowset=256
access([VIEW2.t1.c1], [VIEW2.t1.c2])
19 - output([VIEW3.t1.c1], [VIEW3.T_FUN_COUNT(*)]), filter(nil), rowset=256,
19 - output([VIEW3.t1.c1], [VIEW3.T_FUN_COUNT(*)]), filter(nil), rowset=256
access([VIEW3.t1.c1], [VIEW3.T_FUN_COUNT(*)])
20 - output([VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256,
20 - output([VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)]), filter(nil), rowset=256
access([VIEW1.t1.c1], [VIEW1.t1.c2], [VIEW1.T_FUN_COUNT(*)])
explain select /*+ use_px parallel(2) use_merge(a b) */ b.c2, sum(a.c3) from (select /*+ NO_USE_HASH_AGGREGATION */ c1, c2, count(*) c3 from t1 group by 1, 2) a, t2 b where a.c1 = b.c1 group by 1;
Query Plan
==================================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
------------------------------------------------------------------
|0 |PX COORDINATOR | |1 |5 |
|1 | EXCHANGE OUT DISTR |:EX10003|1 |5 |
|2 | HASH GROUP BY | |1 |5 |
|3 | EXCHANGE IN DISTR | |2 |5 |
|4 | EXCHANGE OUT DISTR (HASH) |:EX10002|2 |4 |
|5 | HASH GROUP BY | |2 |4 |
|6 | SUBPLAN SCAN |VIEW1 |1 |3 |
|7 | MERGE GROUP BY | |1 |3 |
|8 | SORT | |1 |3 |
|9 | MERGE JOIN | |1 |3 |
|10| SORT | |1 |2 |
|11| EXCHANGE IN DISTR | |1 |2 |
|12| EXCHANGE OUT DISTR (HASH)|:EX10000|1 |2 |
|13| PX BLOCK ITERATOR | |1 |1 |
|14| TABLE SCAN |b |1 |1 |
|15| SORT | |1 |2 |
|16| EXCHANGE IN DISTR | |1 |2 |
|17| EXCHANGE OUT DISTR (HASH)|:EX10001|1 |2 |
|18| PX BLOCK ITERATOR | |1 |1 |
|19| TABLE SCAN |t1 |1 |1 |
==================================================================
Outputs & filters:
=========================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-------------------------------------------------------------------------
|0 |PX COORDINATOR | |1 |5 |
|1 | EXCHANGE OUT DISTR |:EX10003|1 |5 |
|2 | HASH GROUP BY | |1 |5 |
|3 | EXCHANGE IN DISTR | |2 |5 |
|4 | EXCHANGE OUT DISTR (HASH) |:EX10002|2 |4 |
|5 | HASH GROUP BY | |2 |4 |
|6 | SUBPLAN SCAN |VIEW1 |1 |3 |
|7 | MERGE GROUP BY | |1 |3 |
|8 | PARTITION SORT | |1 |3 |
|9 | MERGE JOIN | |1 |3 |
|10| SORT | |1 |2 |
|11| EXCHANGE IN DISTR | |1 |2 |
|12| EXCHANGE OUT DISTR (HASH)|:EX10000|1 |2 |
|13| PX BLOCK ITERATOR | |1 |1 |
|14| TABLE SCAN |b |1 |1 |
|15| SORT | |1 |2 |
|16| EXCHANGE IN DISTR | |1 |2 |
|17| EXCHANGE OUT DISTR (HASH)|:EX10001|1 |2 |
|18| PX BLOCK ITERATOR | |1 |1 |
|19| TABLE SCAN |t1 |1 |1 |
=========================================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(VIEW1.b.c2, T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3)))]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(VIEW1.b.c2, T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3)))]), filter(nil), rowset=256, dop=2
2 - output([VIEW1.b.c2], [T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3))]), filter(nil), rowset=256,
1 - output([INTERNAL_FUNCTION(VIEW1.b.c2, T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3)))]), filter(nil), rowset=256
dop=2
2 - output([VIEW1.b.c2], [T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3))]), filter(nil), rowset=256
group([VIEW1.b.c2]), agg_func([T_FUN_SUM(T_FUN_SUM(VIEW1.a.c3))])
3 - output([VIEW1.b.c2], [T_FUN_SUM(VIEW1.a.c3)]), filter(nil), rowset=256
4 - (#keys=1, [VIEW1.b.c2]), output([VIEW1.b.c2], [T_FUN_SUM(VIEW1.a.c3)]), filter(nil), rowset=256, dop=2
5 - output([VIEW1.b.c2], [T_FUN_SUM(VIEW1.a.c3)]), filter(nil), rowset=256,
4 - output([VIEW1.b.c2], [T_FUN_SUM(VIEW1.a.c3)]), filter(nil), rowset=256
(#keys=1, [VIEW1.b.c2]), dop=2
5 - output([VIEW1.b.c2], [T_FUN_SUM(VIEW1.a.c3)]), filter(nil), rowset=256
group([VIEW1.b.c2]), agg_func([T_FUN_SUM(VIEW1.a.c3)])
6 - output([VIEW1.b.c2], [VIEW1.a.c3]), filter(nil), rowset=256,
6 - output([VIEW1.b.c2], [VIEW1.a.c3]), filter(nil), rowset=256
access([VIEW1.b.c2], [VIEW1.a.c3])
7 - output([b.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256,
7 - output([b.c2], [T_FUN_COUNT(*)]), filter(nil), rowset=256
group([b.__pk_increment], [t1.c2]), agg_func([T_FUN_COUNT(*)])
8 - output([b.__pk_increment], [t1.c2], [b.c2]), filter(nil), rowset=256, sort_keys([b.__pk_increment, ASC], [t1.c2, ASC])
9 - output([b.__pk_increment], [t1.c2], [b.c2]), filter(nil), rowset=256,
8 - output([b.__pk_increment], [t1.c2], [b.c2]), filter(nil), rowset=256
sort_keys([HASH(b.__pk_increment, t1.c2), ASC], [b.__pk_increment, ASC], [t1.c2, ASC])
9 - output([b.__pk_increment], [t1.c2], [b.c2]), filter(nil), rowset=256
equal_conds([t1.c1 = b.c1]), other_conds(nil)
10 - output([b.__pk_increment], [b.c2], [b.c1]), filter(nil), rowset=256, sort_keys([b.c1, ASC])
11 - output([b.__pk_increment], [b.c2], [b.c1]), filter(nil), rowset=256
12 - (#keys=1, [b.c1]), output([b.__pk_increment], [b.c2], [b.c1]), filter(nil), rowset=256, dop=2
13 - output([b.__pk_increment], [b.c1], [b.c2]), filter(nil), rowset=256
14 - output([b.__pk_increment], [b.c1], [b.c2]), filter(nil), rowset=256,
merge_directions([ASC])
10 - output([b.__pk_increment], [b.c2], [b.c1]), filter(nil), rowset=256
sort_keys([b.c1, ASC])
11 - output([b.__pk_increment], [b.c2], [b.c1]), filter(nil), rowset=256
12 - output([b.__pk_increment], [b.c2], [b.c1]), filter(nil), rowset=256
(#keys=1, [b.c1]), dop=2
13 - output([b.__pk_increment], [b.c1], [b.c2]), filter(nil), rowset=256
14 - output([b.__pk_increment], [b.c1], [b.c2]), filter(nil), rowset=256
access([b.__pk_increment], [b.c1], [b.c2]), partitions(p0)
15 - output([t1.c2], [t1.c1]), filter(nil), rowset=256, sort_keys([t1.c1, ASC])
16 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
17 - (#keys=1, [t1.c1]), output([t1.c2], [t1.c1]), filter(nil), rowset=256, dop=2
18 - output([t1.c1], [t1.c2]), filter(nil), rowset=256
19 - output([t1.c1], [t1.c2]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([b.__pk_increment]), range(MIN ; MAX)always true
15 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
sort_keys([t1.c1, ASC])
16 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
17 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
(#keys=1, [t1.c1]), dop=2
18 - output([t1.c1], [t1.c2]), filter(nil), rowset=256
19 - output([t1.c1], [t1.c2]), filter(nil), rowset=256
access([t1.c1], [t1.c2]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
explain select /*+ use_px parallel(2) use_merge(a b) */ * from (select /*+ NO_USE_HASH_AGGREGATION */ c1, c2, count(*) c3 from t1 group by 1, 2) a, t2 b where a.c1 = b.c1;
Query Plan
=============================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
-------------------------------------------------------------
|0 |PX COORDINATOR | |1 |5 |
|1 | EXCHANGE OUT DISTR |:EX10002|1 |4 |
|2 | MERGE GROUP BY | |1 |4 |
|3 | SORT | |1 |4 |
|4 | MERGE JOIN | |1 |4 |
|5 | SORT | |1 |2 |
|6 | EXCHANGE IN DISTR | |1 |2 |
|7 | EXCHANGE OUT DISTR (HASH)|:EX10000|1 |2 |
|8 | PX BLOCK ITERATOR | |1 |1 |
|9 | TABLE SCAN |t1 |1 |1 |
|10| SORT | |1 |2 |
|11| EXCHANGE IN DISTR | |1 |2 |
|12| EXCHANGE OUT DISTR (HASH)|:EX10001|1 |2 |
|13| PX BLOCK ITERATOR | |1 |1 |
|14| TABLE SCAN |b |1 |1 |
=============================================================
Outputs & filters:
====================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------------------------------
|0 |PX COORDINATOR | |1 |5 |
|1 | EXCHANGE OUT DISTR |:EX10002|1 |4 |
|2 | MERGE GROUP BY | |1 |4 |
|3 | PARTITION SORT | |1 |4 |
|4 | MERGE JOIN | |1 |4 |
|5 | SORT | |1 |2 |
|6 | EXCHANGE IN DISTR | |1 |2 |
|7 | EXCHANGE OUT DISTR (HASH)|:EX10000|1 |2 |
|8 | PX BLOCK ITERATOR | |1 |1 |
|9 | TABLE SCAN |t1 |1 |1 |
|10| SORT | |1 |2 |
|11| EXCHANGE IN DISTR | |1 |2 |
|12| EXCHANGE OUT DISTR (HASH)|:EX10001|1 |2 |
|13| PX BLOCK ITERATOR | |1 |1 |
|14| TABLE SCAN |b |1 |1 |
====================================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, T_FUN_COUNT(*), b.c1, b.c2, b.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, T_FUN_COUNT(*), b.c1, b.c2, b.c3)]), filter(nil), rowset=256, dop=2
2 - output([t1.c2], [T_FUN_COUNT(*)], [t1.c1], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256,
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, T_FUN_COUNT(*), b.c1, b.c2, b.c3)]), filter(nil), rowset=256
dop=2
2 - output([t1.c2], [T_FUN_COUNT(*)], [t1.c1], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256
group([b.__pk_increment], [t1.c2]), agg_func([T_FUN_COUNT(*)])
3 - output([t1.c2], [b.__pk_increment], [t1.c1], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, sort_keys([b.__pk_increment, ASC], [t1.c2, ASC])
4 - output([t1.c2], [b.__pk_increment], [t1.c1], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256,
3 - output([t1.c2], [b.__pk_increment], [t1.c1], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256
sort_keys([HASH(b.__pk_increment, t1.c2), ASC], [b.__pk_increment, ASC], [t1.c2, ASC])
4 - output([t1.c2], [b.__pk_increment], [t1.c1], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256
equal_conds([t1.c1 = b.c1]), other_conds(nil)
5 - output([t1.c2], [t1.c1]), filter(nil), rowset=256, sort_keys([t1.c1, ASC])
merge_directions([ASC])
5 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
sort_keys([t1.c1, ASC])
6 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
7 - (#keys=1, [t1.c1]), output([t1.c2], [t1.c1]), filter(nil), rowset=256, dop=2
7 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
(#keys=1, [t1.c1]), dop=2
8 - output([t1.c1], [t1.c2]), filter(nil), rowset=256
9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256,
9 - output([t1.c1], [t1.c2]), filter(nil), rowset=256
access([t1.c1], [t1.c2]), partitions(p0)
10 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, sort_keys([b.c1, ASC])
11 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256
12 - (#keys=1, [b.c1]), output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256, dop=2
13 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256
14 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
10 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256
sort_keys([b.c1, ASC])
11 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256
12 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256
(#keys=1, [b.c1]), dop=2
13 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256
14 - output([b.__pk_increment], [b.c1], [b.c2], [b.c3]), filter(nil), rowset=256
access([b.__pk_increment], [b.c1], [b.c2], [b.c3]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([b.__pk_increment]), range(MIN ; MAX)always true

View File

@ -7,118 +7,129 @@ create table t1 (c1 int(11) not null, c2 int(11) not null, c3 int(11) not null,
explain select * from t1;
Query Plan
====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
====================================================
Outputs & filters:
===========================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
===========================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256, dop=1
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
dop=1
2 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
force partition granule
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3]), partitions(p[0-3])
is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.c2], [t1.c3]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
explain select /*+use_px*/ * from t1;
Query Plan
====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
====================================================
Outputs & filters:
===========================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
===========================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256, dop=1
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
dop=1
2 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
force partition granule
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3]), partitions(p[0-3])
is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.c2], [t1.c3]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
explain select /*+use_px parallel(15)*/ * from t1;
Query Plan
================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
------------------------------------------------
|0 |PX COORDINATOR | |1 |1 |
|1 | EXCHANGE OUT DISTR|:EX10000|1 |1 |
|2 | PX BLOCK ITERATOR| |1 |1 |
|3 | TABLE SCAN |t1 |1 |1 |
================================================
Outputs & filters:
=======================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-------------------------------------------------------
|0 |PX COORDINATOR | |1 |1 |
|1 | EXCHANGE OUT DISTR|:EX10000|1 |1 |
|2 | PX BLOCK ITERATOR| |1 |1 |
|3 | TABLE SCAN |t1 |1 |1 |
=======================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256, dop=15
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
dop=15
2 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3]), partitions(p[0-3])
is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.c2], [t1.c3]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
explain select /*+no_use_px */ * from t1;
Query Plan
====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
====================================================
Outputs & filters:
===========================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
===========================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256, dop=1
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
dop=1
2 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
force partition granule
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3]), partitions(p[0-3])
is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.c2], [t1.c3]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
explain select /*+no_use_px use_px*/ * from t1;
Query Plan
====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
====================================================
Outputs & filters:
===========================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
===========================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256, dop=1
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
dop=1
2 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
force partition granule
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3]), partitions(p[0-3])
is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.c2], [t1.c3]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
explain select /*+use_px no_use_px */ * from t1;
Query Plan
====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
====================================================
Outputs & filters:
===========================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------
|0 |PX COORDINATOR | |1 |9 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |8 |
|2 | PX PARTITION ITERATOR| |1 |7 |
|3 | TABLE SCAN |t1 |1 |7 |
===========================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256, dop=1
1 - output([INTERNAL_FUNCTION(t1.c1, t1.c2, t1.c3)]), filter(nil), rowset=256
dop=1
2 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
force partition granule
3 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3]), partitions(p[0-3])
is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.c2], [t1.c3]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
drop table if exists t7;
create table t7(a int, b int, c int, d int, primary key (a)) partition by hash(a) partitions 3;

File diff suppressed because it is too large Load Diff

View File

@ -70,33 +70,41 @@ insert into score values
(64, 'MA', 87);
explain select /*+ USE_PX parallel(2) */ * from stu, score where stu.sid = score.sid order by score.sid;
Query Plan
=======================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
-------------------------------------------------------
|0 |PX COORDINATOR MERGE SORT | |1 |13 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |12 |
|2 | SORT | |1 |11 |
|3 | PX PARTITION ITERATOR | |1 |11 |
|4 | MERGE JOIN | |1 |11 |
|5 | TABLE SCAN |score |1 |6 |
|6 | SORT | |1 |6 |
|7 | TABLE SCAN |stu |1 |6 |
=======================================================
Outputs & filters:
==============================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------------------------
|0 |PX COORDINATOR MERGE SORT | |1 |13 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |12 |
|2 | SORT | |1 |11 |
|3 | PX PARTITION ITERATOR | |1 |11 |
|4 | MERGE JOIN | |1 |11 |
|5 | TABLE SCAN |score |1 |6 |
|6 | SORT | |1 |6 |
|7 | TABLE SCAN |stu |1 |6 |
==============================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256, sort_keys([score.sid, ASC])
1 - output([score.sid], [INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256, dop=2
2 - output([score.sid], [stu.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256, sort_keys([score.sid, ASC]), local merge sort
0 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256
sort_keys([score.sid, ASC])
1 - output([score.sid], [INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256
dop=2
2 - output([score.sid], [stu.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256
sort_keys([score.sid, ASC]), local merge sort
3 - output([score.sid], [stu.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256
4 - output([score.sid], [stu.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256,
partition wise, force partition granule
4 - output([score.sid], [stu.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256
equal_conds([stu.sid = score.sid]), other_conds(nil)
5 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256,
merge_directions([ASC])
5 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256
access([score.sid], [score.subject], [score.score]), partitions(p[0-5])
6 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256, sort_keys([stu.sid, ASC])
7 - output([stu.cls], [stu.sid], [stu.name]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([score.sid], [score.subject]), range(MIN,MIN ; MAX,MAX)always true
6 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256
sort_keys([stu.sid, ASC])
7 - output([stu.cls], [stu.sid], [stu.name]), filter(nil), rowset=256
access([stu.cls], [stu.sid], [stu.name]), partitions(p[0-5])
is_index_back=false, is_global_index=false,
range_key([stu.cls], [stu.sid]), range(MIN,MIN ; MAX,MAX)always true
select /*+ USE_PX parallel(2) */ * from stu, score where stu.sid = score.sid order by score.sid;
sid name cls sid subject score
11 a1 1 11 EN 60

View File

@ -70,37 +70,41 @@ insert into score values
(64, 'MA', 87);
explain select /*+ USE_PX parallel(2) */ * from stu, score where stu.sid != score.sid and stu.sid < 12;
Query Plan
================================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------------------
|0 |PX COORDINATOR | |0 |11 |
|1 | EXCHANGE OUT DISTR |:EX10001|0 |11 |
|2 | NESTED-LOOP JOIN | |0 |11 |
|3 | PX BLOCK ITERATOR | |1 |6 |
|4 | TABLE SCAN |score |1 |6 |
|5 | MATERIAL | |1 |6 |
|6 | EXCHANGE IN DISTR | |1 |6 |
|7 | EXCHANGE OUT DISTR (BROADCAST)|:EX10000|1 |6 |
|8 | PX BLOCK ITERATOR | |1 |6 |
|9 | TABLE SCAN |stu |1 |6 |
================================================================
Outputs & filters:
=======================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------------------
|0 |PX COORDINATOR | |0 |11 |
|1 | EXCHANGE OUT DISTR |:EX10001|0 |11 |
|2 | NESTED-LOOP JOIN | |0 |11 |
|3 | PX BLOCK ITERATOR | |1 |6 |
|4 | TABLE SCAN |score |1 |6 |
|5 | MATERIAL | |1 |6 |
|6 | EXCHANGE IN DISTR | |1 |6 |
|7 | EXCHANGE OUT DISTR (BROADCAST)|:EX10000|1 |6 |
|8 | PX BLOCK ITERATOR | |1 |6 |
|9 | TABLE SCAN |stu |1 |6 |
=======================================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256, dop=2
2 - output([stu.sid], [score.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256,
conds([stu.sid != score.sid]), nl_params_(nil)
1 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256
dop=2
2 - output([stu.sid], [score.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256
conds([stu.sid != score.sid]), nl_params_(nil), batch_join=false
3 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256
4 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256,
4 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256
access([score.sid], [score.subject], [score.score]), partitions(p[0-5])
is_index_back=false, is_global_index=false,
range_key([score.sid], [score.subject]), range(MIN,MIN ; MAX,MAX)always true
5 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256
6 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256
7 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256, dop=2
7 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256
dop=2
8 - output([stu.cls], [stu.sid], [stu.name]), filter(nil), rowset=256
9 - output([stu.cls], [stu.sid], [stu.name]), filter([stu.sid < 12]), rowset=256,
9 - output([stu.cls], [stu.sid], [stu.name]), filter([stu.sid < 12]), rowset=256
access([stu.cls], [stu.sid], [stu.name]), partitions(p[0-5])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([stu.cls], [stu.sid]), range(MIN,MIN ; MAX,MAX)always true
select /*+ USE_PX parallel(2) */ * from stu, score where stu.sid != score.sid and stu.sid < 12;
sid name cls sid subject score
11 a1 1 12 EN 70
@ -131,35 +135,40 @@ sid name cls sid subject score
11 a1 1 64 MA 87
explain select /*+ USE_PX parallel(2) */ * from score, teacher where teacher.subject = score.subject and teacher.tid = 1;
Query Plan
=============================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
-------------------------------------------------------------
|0 |PX COORDINATOR | |1 |10 |
|1 | EXCHANGE OUT DISTR |:EX10001|1 |9 |
|2 | SHARED HASH JOIN | |1 |8 |
|3 | EXCHANGE IN DISTR | |1 |6 |
|4 | EXCHANGE OUT DISTR (BC2HOST)|:EX10000|1 |6 |
|5 | PX BLOCK ITERATOR | |1 |6 |
|6 | TABLE SCAN |score |1 |6 |
|7 | PX BLOCK ITERATOR | |1 |2 |
|8 | TABLE GET |teacher |1 |2 |
=============================================================
Outputs & filters:
====================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------------------------------
|0 |PX COORDINATOR | |1 |10 |
|1 | EXCHANGE OUT DISTR |:EX10001|1 |9 |
|2 | SHARED HASH JOIN | |1 |8 |
|3 | EXCHANGE IN DISTR | |1 |6 |
|4 | EXCHANGE OUT DISTR (BC2HOST)|:EX10000|1 |6 |
|5 | PX BLOCK ITERATOR | |1 |6 |
|6 | TABLE SCAN |score |1 |6 |
|7 | PX BLOCK ITERATOR | |1 |2 |
|8 | TABLE GET |teacher |1 |2 |
====================================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(score.sid, score.subject, score.score, teacher.tid, teacher.name, teacher.subject)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(score.sid, score.subject, score.score, teacher.tid, teacher.name, teacher.subject)]), filter(nil), rowset=256, dop=2
2 - output([teacher.subject], [score.subject], [score.sid], [score.score], [teacher.tid], [teacher.name]), filter(nil), rowset=256,
1 - output([INTERNAL_FUNCTION(score.sid, score.subject, score.score, teacher.tid, teacher.name, teacher.subject)]), filter(nil), rowset=256
dop=2
2 - output([teacher.subject], [score.subject], [score.sid], [score.score], [teacher.tid], [teacher.name]), filter(nil), rowset=256
equal_conds([teacher.subject = score.subject]), other_conds(nil)
3 - output([score.subject], [score.sid], [score.score]), filter(nil), rowset=256
4 - output([score.subject], [score.sid], [score.score]), filter(nil), rowset=256, dop=2
4 - output([score.subject], [score.sid], [score.score]), filter(nil), rowset=256
dop=2
5 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256
6 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256,
6 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256
access([score.sid], [score.subject], [score.score]), partitions(p[0-5])
is_index_back=false, is_global_index=false,
range_key([score.sid], [score.subject]), range(MIN,MIN ; MAX,MAX)always true
7 - output([teacher.tid], [teacher.subject], [teacher.name]), filter(nil), rowset=256
8 - output([teacher.tid], [teacher.subject], [teacher.name]), filter(nil), rowset=256,
8 - output([teacher.tid], [teacher.subject], [teacher.name]), filter(nil), rowset=256
access([teacher.tid], [teacher.subject], [teacher.name]), partitions(p1)
is_index_back=false, is_global_index=false,
range_key([teacher.tid]), range[1 ; 1],
range_cond([teacher.tid = 1])
select /*+ USE_PX parallel(2) */ * from score, teacher where teacher.subject = score.subject and teacher.tid = 1;
sid subject score tid name subject
11 EN 60 1 Miss Zhang EN

View File

@ -70,31 +70,37 @@ insert into score values
(64, 'MA', 87);
explain select /*+ USE_PX parallel(2) */ * from stu, score where stu.sid = score.sid;
Query Plan
====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------------
|0 |PX COORDINATOR | |1 |13 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |12 |
|2 | PX PARTITION ITERATOR| |1 |11 |
|3 | MERGE JOIN | |1 |11 |
|4 | TABLE SCAN |score |1 |6 |
|5 | SORT | |1 |6 |
|6 | TABLE SCAN |stu |1 |6 |
====================================================
Outputs & filters:
===========================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------
|0 |PX COORDINATOR | |1 |13 |
|1 | EXCHANGE OUT DISTR |:EX10000|1 |12 |
|2 | PX PARTITION ITERATOR| |1 |11 |
|3 | MERGE JOIN | |1 |11 |
|4 | TABLE SCAN |score |1 |6 |
|5 | SORT | |1 |6 |
|6 | TABLE SCAN |stu |1 |6 |
===========================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256, dop=2
1 - output([INTERNAL_FUNCTION(stu.sid, stu.name, stu.cls, score.sid, score.subject, score.score)]), filter(nil), rowset=256
dop=2
2 - output([stu.sid], [score.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256
3 - output([stu.sid], [score.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256,
partition wise, force partition granule
3 - output([stu.sid], [score.sid], [score.subject], [score.score], [stu.cls], [stu.name]), filter(nil), rowset=256
equal_conds([stu.sid = score.sid]), other_conds(nil)
4 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256,
merge_directions([ASC])
4 - output([score.sid], [score.subject], [score.score]), filter(nil), rowset=256
access([score.sid], [score.subject], [score.score]), partitions(p[0-5])
5 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256, sort_keys([stu.sid, ASC])
6 - output([stu.cls], [stu.sid], [stu.name]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([score.sid], [score.subject]), range(MIN,MIN ; MAX,MAX)always true
5 - output([stu.sid], [stu.cls], [stu.name]), filter(nil), rowset=256
sort_keys([stu.sid, ASC])
6 - output([stu.cls], [stu.sid], [stu.name]), filter(nil), rowset=256
access([stu.cls], [stu.sid], [stu.name]), partitions(p[0-5])
is_index_back=false, is_global_index=false,
range_key([stu.cls], [stu.sid]), range(MIN,MIN ; MAX,MAX)always true
select /*+ USE_PX parallel(2) */ * from stu, score where stu.sid = score.sid;
sid name cls sid subject score
11 a1 1 11 EN 60

View File

@ -117,7 +117,7 @@ select query_sql, EXPECTED_WORKER_COUNT, USED_WORKER_COUNT from oceanbase.GV$OB_
| select /*+ TEST_SQL_AUDIT USE_PX parallel(2) */ subject, avg(score), max(score), min(score) from score group by subject | 4 | 4 |
| select /*+ TEST_SQL_AUDIT USE_PX parallel(3) */ * from teacher | 3 | 3 |
| select /*+ TEST_SQL_AUDIT USE_PX parallel(3) */ cls, subject, avg(score), max(score), min(score) from score join stu using (sid) group by cls, subject | 6 | 6 |
| select /*+ TEST_SQL_AUDIT USE_PX parallel(3) */ count(*) from score join stu using (sid) inner join teacher where score.subject = teacher.subject | 9 | 9 |
| select /*+ TEST_SQL_AUDIT USE_PX parallel(3) */ count(*) from score join stu using (sid) inner join teacher where score.subject = teacher.subject | 6 | 6 |
| select /*+ TEST_SQL_AUDIT USE_PX parallel(3) */ subject, avg(score), max(score), min(score) from score group by subject | 6 | 6 |
| select /*+ TEST_SQL_AUDIT USE_PX parallel(4) */ * from teacher | 4 | 4 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+-------------------+

View File

@ -26,22 +26,20 @@ select * from t1;
explain insert into t2 (c1, c2) values ('0', '1');
Query Plan
===========================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-------------------------------------------
|0 |DISTRIBUTED INSERT| |1 |13 |
|1 | EXPRESSION | |1 |1 |
===========================================
Outputs & filters:
==================================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
--------------------------------------------------
|0 |DISTRIBUTED INSERT| |1 |13 |
|1 | EXPRESSION | |1 |1 |
==================================================
Outputs & filters:
-------------------------------------
0 - output(nil), filter(nil),
0 - output(nil), filter(nil)
columns([{t2: ({t2: (t2.c1, t2.c2)})}]),
column_values([column_conv(INT,PS:(11,0),NOT NULL,t2.c1.nextval(column_conv(INT,PS:(11,0),NOT NULL,__values.c1)))], [column_conv(INT,PS:(11,0),NULL,__values.c2)])
1 - output([__values.c1], [__values.c2]), filter(nil)
values({'0', '1'})
insert into t2 (c1, c2) values (NULL, '1');
insert into t2 (c1, c2) values (0, '2');
insert into t2 (c2) values ('3');

View File

@ -7319,17 +7319,17 @@ insert into t1 values('1901-01-01', 1901);
explain_protocol: 2
EXPLAIN select nullif(c1, c2) from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([nullif(t1.c1, t1.c2)]), filter(nil), rowset=256,
0 - output([nullif(t1.c1, t1.c2)]), filter(nil), rowset=256
access([t1.c1], [t1.c2]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select nullif(c1, c2) from t1;
+---------------------------+
| nullif(c1, c2) |
@ -7338,17 +7338,17 @@ select nullif(c1, c2) from t1;
+---------------------------+
EXPLAIN select nullif(c2, c1) from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([nullif(t1.c2, t1.c1)]), filter(nil), rowset=256,
0 - output([nullif(t1.c2, t1.c1)]), filter(nil), rowset=256
access([t1.c2], [t1.c1]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select nullif(c2, c1) from t1;
+----------------+
| nullif(c2, c1) |
@ -7357,17 +7357,17 @@ select nullif(c2, c1) from t1;
+----------------+
EXPLAIN select nullif(c1, c1) from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([nullif(t1.c1, t1.c1)]), filter(nil), rowset=256,
0 - output([nullif(t1.c1, t1.c1)]), filter(nil), rowset=256
access([t1.c1]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select nullif(c1, c1) from t1;
+----------------+
| nullif(c1, c1) |
@ -7376,17 +7376,17 @@ select nullif(c1, c1) from t1;
+----------------+
EXPLAIN select nullif(c2, c2) from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([nullif(t1.c2, t1.c2)]), filter(nil), rowset=256,
0 - output([nullif(t1.c2, t1.c2)]), filter(nil), rowset=256
access([t1.c2]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select nullif(c2, c2) from t1;
+----------------+
| nullif(c2, c2) |

View File

@ -22,7 +22,7 @@ select regexp_like('abc', 'a.* ', NULL) from dual;
| NULL |
+----------------------------------+
select regexp_like('abc', 'a.* ', 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_like('abc', NULL) from dual;
+--------------------------+
| regexp_like('abc', NULL) |
@ -74,17 +74,17 @@ select regexp_instr('abcadef', 'a.', 1, 2, 1) from dual;
| 6 |
+----------------------------------------+
select regexp_instr('abcadef', 'a.', 0, 2, 1) from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use position or occurrence or return_option or subexpr in regexp_instr
select regexp_instr('abcadef', 'a.', 1, 0, 1) from dual;
ERROR HY000: Invalid argument
+----------------------------------------+
| regexp_instr('abcadef', 'a.', 1, 0, 1) |
+----------------------------------------+
| 3 |
+----------------------------------------+
select regexp_instr('abcadef', 'a.', 1, 2, -1) from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use position or occurrence or return_option or subexpr in regexp_instr
select regexp_instr('abcadef', 'a.', 100, 2) from dual;
+---------------------------------------+
| regexp_instr('abcadef', 'a.', 100, 2) |
+---------------------------------------+
| 0 |
+---------------------------------------+
ERROR 42000: Got error 'U_INDEX_OUTOFBOUNDS_ERROR' from regexp
select regexp_instr('abcadef', 'a.', 1, 200) from dual;
+---------------------------------------+
| regexp_instr('abcadef', 'a.', 1, 200) |
@ -92,17 +92,17 @@ select regexp_instr('abcadef', 'a.', 1, 200) from dual;
| 0 |
+---------------------------------------+
select regexp_instr('abcadef', 'a. ', 1, 2, 1, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_instr('', 'a. ', 1, 2, 1, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_instr('abcadef', '', 1, 2, 1, 'x') from dual;
ERROR 42000: Got error from regexp
select regexp_instr('abcadef', 'a. ', NULL, 2, 1, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_instr('abcadef', 'a. ', 1, NULL, 1, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_instr('abcadef', 'a. ', 1, 2, NULL, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_instr('abcadef', 'a. ', 1, 2, 1, NULL) from dual;
+-----------------------------------------------+
| regexp_instr('abcadef', 'a. ', 1, 2, 1, NULL) |
@ -136,15 +136,11 @@ select regexp_substr('abcadef', 'a.', 1, 2) from dual;
| ad |
+--------------------------------------+
select regexp_substr('abcadef', 'a.', 0, 2) from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use position or occurrence or subexpr in regexp_substr
select regexp_substr('abcadef', 'a.', 1, 0) from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use position or occurrence or subexpr in regexp_substr
select regexp_substr('abcadef', 'a.', 10, 2) from dual;
+---------------------------------------+
| regexp_substr('abcadef', 'a.', 10, 2) |
+---------------------------------------+
| NULL |
+---------------------------------------+
ERROR 42000: Got error 'U_INDEX_OUTOFBOUNDS_ERROR' from regexp
select regexp_substr('abcadef', 'a.', 1, 10) from dual;
+---------------------------------------+
| regexp_substr('abcadef', 'a.', 1, 10) |
@ -152,15 +148,15 @@ select regexp_substr('abcadef', 'a.', 1, 10) from dual;
| NULL |
+---------------------------------------+
select regexp_substr('abcadef', 'a. ', 1, 2, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_substr('', 'a. ', 1, 2, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_substr('abcadef', '', 1, 2, 'x') from dual;
ERROR 42000: Got error from regexp
select regexp_substr('abcadef', 'a. ', NULL, 2, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_substr('abcadef', 'a. ', 1, NULL, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_substr('abcadef', 'a. ', 1, 2, NULL) from dual;
+---------------------------------------------+
| regexp_substr('abcadef', 'a. ', 1, 2, NULL) |
@ -232,13 +228,9 @@ select regexp_replace('abcadef', 'a.', 'X', 1, 0) from dual;
| XcXef |
+--------------------------------------------+
select regexp_replace('abcadef', 'a.', 'X', 1, -1) from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use position or occurrence in regexp_replace
select regexp_replace('abcadef', 'a.', 'X', 10, 2) from dual;
+---------------------------------------------+
| regexp_replace('abcadef', 'a.', 'X', 10, 2) |
+---------------------------------------------+
| abcadef |
+---------------------------------------------+
ERROR 42000: Got error 'U_INDEX_OUTOFBOUNDS_ERROR' from regexp
select regexp_replace('abcadef', 'a.', 'X', 1, 100) from dual;
+----------------------------------------------+
| regexp_replace('abcadef', 'a.', 'X', 1, 100) |
@ -252,17 +244,17 @@ select regexp_replace('abcadef', 'a. ', 'X', 1, 2) from dual;
| abcadef |
+---------------------------------------------+
select regexp_replace('abcadef', 'a. ', 'X', 1, 2, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_replace('', 'a. ', 'X', 1, 2, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_replace('abcadef', '', 'X', 1, 2, 'x') from dual;
ERROR 42000: Got error from regexp
select regexp_replace('abcadef', 'a. ', NULL, 1, 2, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_replace('abcadef', 'a. ', 'X', NULL, 2, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_replace('abcadef', 'a. ', 'X', 1, NULL, 'x') from dual;
ERROR HY000: Invalid argument
ERROR HY000: Incorrect arguments to use match param in regexp expression
select regexp_replace('abcadef', 'a. ', 'X', 1, 2, NULL) from dual;
+---------------------------------------------------+
| regexp_replace('abcadef', 'a. ', 'X', 1, 2, NULL) |

View File

@ -390,22 +390,22 @@ select * from t2 order by sign(a4) ;
| a1 | a2 | a3 | a4 | a5 |
+-----+------+------+--------+---------------------+
| XXX | NULL | MIN | NULL | timestamp |
| WWW | 1 | LED | NULL | timestamp |
| SSJ | NULL | CHI | NULL | timestamp |
| KKK | -3 | ATL | NULL | timestamp |
| BDL | 0 | DEN | -0.08 | timestamp |
| ZAJ | 2 | CHI | -0.075 | timestamp |
| TWU | 0 | LAX | -0.08 | timestamp |
| PLS | -1 | WDC | -0.075 | timestamp |
| GTM | 3 | DAL | -0.07 | timestamp |
| SSJ | NULL | CHI | NULL | timestamp |
| WWW | 1 | LED | NULL | timestamp |
| GG3 | -3 | DD3 | -0.051 | timestamp |
| BOT | -2 | SEA | -0.085 | timestamp |
| GTM | 3 | DAL | -0.07 | timestamp |
| ZAJ | 2 | CHI | -0.075 | timestamp |
| BDL | 0 | DEN | -0.08 | timestamp |
| PLS | -1 | WDC | -0.075 | timestamp |
| BMC | 3 | SEA | -0.085 | timestamp |
| TWU | 0 | LAX | -0.08 | timestamp |
| BOT | -2 | SEA | -0.085 | timestamp |
| HBR | 1 | SEA | 0.085 | timestamp |
| GG2 | -3 | DD2 | 0.052 | timestamp |
| GG1 | 3 | DD1 | 0.053 | timestamp |
| DTX | 1 | NYC | 0.08 | timestamp |
| VVV | -2 | MON | 0.075 | timestamp |
| GG1 | 3 | DD1 | 0.053 | timestamp |
| GG2 | -3 | DD2 | 0.052 | timestamp |
| AME | 0 | SEA | 0.1 | timestamp |
+-----+------+------+--------+---------------------+
select * from t2 order by sign(a4) , a4 ;
@ -413,9 +413,9 @@ select * from t2 order by sign(a4) , a4 ;
| a1 | a2 | a3 | a4 | a5 |
+-----+------+------+--------+---------------------+
| XXX | NULL | MIN | NULL | timestamp |
| WWW | 1 | LED | NULL | timestamp |
| SSJ | NULL | CHI | NULL | timestamp |
| KKK | -3 | ATL | NULL | timestamp |
| SSJ | NULL | CHI | NULL | timestamp |
| WWW | 1 | LED | NULL | timestamp |
| BMC | 3 | SEA | -0.085 | timestamp |
| BOT | -2 | SEA | -0.085 | timestamp |
| BDL | 0 | DEN | -0.08 | timestamp |
@ -720,22 +720,22 @@ select * from t2 order by sign(a4) for update;
| a1 | a2 | a3 | a4 | a5 |
+-----+------+------+--------+---------------------+
| XXX | NULL | MIN | NULL | NULL |
| WWW | 1 | LED | NULL | NULL |
| SSJ | NULL | CHI | NULL | 1974-03-19 00:00:00 |
| KKK | -3 | ATL | NULL | NULL |
| BDL | 0 | DEN | -0.08 | 1960-11-27 00:00:00 |
| ZAJ | 2 | CHI | -0.075 | 1960-06-15 00:00:00 |
| TWU | 0 | LAX | -0.08 | 1969-10-05 00:00:00 |
| PLS | -1 | WDC | -0.075 | 1949-01-02 00:00:00 |
| GTM | 3 | DAL | -0.07 | 1977-09-23 00:00:00 |
| SSJ | NULL | CHI | NULL | 1974-03-19 00:00:00 |
| WWW | 1 | LED | NULL | NULL |
| GG3 | -3 | DD3 | -0.051 | 1974-03-19 00:00:00 |
| BOT | -2 | SEA | -0.085 | 1951-11-29 00:00:00 |
| GTM | 3 | DAL | -0.07 | 1977-09-23 00:00:00 |
| ZAJ | 2 | CHI | -0.075 | 1960-06-15 00:00:00 |
| BDL | 0 | DEN | -0.08 | 1960-11-27 00:00:00 |
| PLS | -1 | WDC | -0.075 | 1949-01-02 00:00:00 |
| BMC | 3 | SEA | -0.085 | 1958-09-08 00:00:00 |
| TWU | 0 | LAX | -0.08 | 1969-10-05 00:00:00 |
| BOT | -2 | SEA | -0.085 | 1951-11-29 00:00:00 |
| HBR | 1 | SEA | 0.085 | 1948-03-05 00:00:00 |
| GG2 | -3 | DD2 | 0.052 | 1974-03-19 00:00:00 |
| GG1 | 3 | DD1 | 0.053 | 1974-03-19 00:00:00 |
| DTX | 1 | NYC | 0.08 | 1961-05-04 00:00:00 |
| VVV | -2 | MON | 0.075 | 1959-06-28 00:00:00 |
| GG1 | 3 | DD1 | 0.053 | 1974-03-19 00:00:00 |
| GG2 | -3 | DD2 | 0.052 | 1974-03-19 00:00:00 |
| AME | 0 | SEA | 0.1 | 1942-02-19 00:00:00 |
+-----+------+------+--------+---------------------+
select abs(a2) , sum(a4) from t2 group by abs(a2) having sum(sign(a4)) > 0 for update;

View File

@ -110,17 +110,15 @@ select substr(3.14159, 2, 3) from dual;
+-----------------------+
explain select substr(3.14159, '2', '3') from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([substr(cast(3.14159, VARCHAR(1048576)), cast('2', BIGINT(-1, 0)), cast('3', BIGINT(-1, 0)))]), filter(nil)
values({substr(cast(3.14159, VARCHAR(1048576)), cast('2', BIGINT(-1, 0)), cast('3', BIGINT(-1, 0)))})
select substr(3.14159, '2', '2.1') from dual;
+-----------------------------+
| substr(3.14159, '2', '2.1') |

View File

@ -26,46 +26,50 @@ explain_protocol: 2
set @@ob_enable_plan_cache = 0;
explain select * from t1,t2;
Query Plan
===================================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
---------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN| |25 |6 |
|1 | TABLE SCAN |t1 |5 |3 |
|2 | MATERIAL | |5 |3 |
|3 | TABLE SCAN |t2 |5 |3 |
===================================================
Outputs & filters:
===========================================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN | |25 |6 |
|1 | TABLE SCAN |t1 |5 |3 |
|2 | MATERIAL | |5 |3 |
|3 | TABLE SCAN |t2 |5 |3 |
===========================================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256,
conds(nil), nl_params_(nil)
1 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256
conds(nil), nl_params_(nil), batch_join=false
1 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
2 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256
3 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256,
3 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256
access([t2.c1], [t2.c2], [t2.c3]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.__pk_increment]), range(MIN ; MAX)always true
EXPLAIN select * from t1,t2;
Query Plan
===================================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
---------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN| |25 |6 |
|1 | TABLE SCAN |t1 |5 |3 |
|2 | MATERIAL | |5 |3 |
|3 | TABLE SCAN |t2 |5 |3 |
===================================================
Outputs & filters:
===========================================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN | |25 |6 |
|1 | TABLE SCAN |t1 |5 |3 |
|2 | MATERIAL | |5 |3 |
|3 | TABLE SCAN |t2 |5 |3 |
===========================================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256,
conds(nil), nl_params_(nil)
1 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256
conds(nil), nl_params_(nil), batch_join=false
1 - output([t1.c1], [t1.c2], [t1.c3]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
2 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256
3 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256,
3 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil), rowset=256
access([t2.c1], [t2.c2], [t2.c3]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.__pk_increment]), range(MIN ; MAX)always true
select * from t1,t2;
+------+------+------+------+------+------+
| c1 | c2 | c3 | c1 | c2 | c3 |

View File

@ -57,15 +57,17 @@ Query Plan
|2 | PX PARTITION ITERATOR| |
|3 | TABLE SCAN |a |
=====================================
Outputs & filters:
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256, dop=1
1 - output([INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256
dop=1
2 - output([a.c1], [a.c2]), filter(nil), rowset=256
3 - output([a.c1], [a.c2]), filter(nil), rowset=256,
force partition granule
3 - output([a.c1], [a.c2]), filter(nil), rowset=256
access([a.c1], [a.c2]), partitions(p[0-4])
is_index_back=false, is_global_index=false,
range_key([a.c1]), range(MIN ; MAX)always true
select * from t3 a ;
+----+------+
| c1 | c2 |
@ -91,16 +93,19 @@ Query Plan
|3 | PX BLOCK ITERATOR | |
|4 | TABLE SCAN |a |
========================================
Outputs & filters:
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(a.c1, a.c2 + a.c1)]), filter(nil), rowset=256, sort_keys([a.c2 + 1 + a.c1, ASC])
1 - output([a.c2 + 1 + a.c1], [INTERNAL_FUNCTION(a.c1, a.c2 + a.c1)]), filter(nil), rowset=256, dop=2
2 - output([a.c2 + 1 + a.c1], [a.c1], [a.c2]), filter(nil), rowset=256, sort_keys([a.c2 + 1 + a.c1, ASC])
0 - output([INTERNAL_FUNCTION(a.c1, a.c2 + a.c1)]), filter(nil), rowset=256
sort_keys([a.c2 + 1 + a.c1, ASC])
1 - output([a.c2 + 1 + a.c1], [INTERNAL_FUNCTION(a.c1, a.c2 + a.c1)]), filter(nil), rowset=256
dop=2
2 - output([a.c2 + 1 + a.c1], [a.c1], [a.c2]), filter(nil), rowset=256
sort_keys([a.c2 + 1 + a.c1, ASC])
3 - output([a.c1], [a.c2]), filter(nil), rowset=256
4 - output([a.c1], [a.c2]), filter(nil), rowset=256,
4 - output([a.c1], [a.c2]), filter(nil), rowset=256
access([a.c1], [a.c2]), partitions(p[0-4])
is_index_back=false, is_global_index=false,
range_key([a.c1]), range(MIN ; MAX)always true
select /*+ parallel(2) NO_USE_HASH_AGGREGATION */ a.c1,a.c2+a.c1 from t3 a group by a.c1,a.c2 order by a.c2+1+a.c1;
+----+-----------+
| c1 | a.c2+a.c1 |
@ -131,23 +136,30 @@ Query Plan
|8 | PX PARTITION ITERATOR | |
|9 | TABLE SCAN |b |
============================================
Outputs & filters:
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256, sort_keys([a.c1, ASC], [a.c2, ASC])
1 - output([a.c1], [a.c2], [INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256, dop=2
2 - output([a.c1], [a.c2]), filter(nil), rowset=256, sort_keys([a.c1, ASC], [a.c2, ASC])
3 - output([a.c1], [a.c2]), filter(nil), rowset=256,
0 - output([INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256
sort_keys([a.c1, ASC], [a.c2, ASC])
1 - output([a.c1], [a.c2], [INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256
dop=2
2 - output([a.c1], [a.c2]), filter(nil), rowset=256
sort_keys([a.c1, ASC], [a.c2, ASC])
3 - output([a.c1], [a.c2]), filter(nil), rowset=256
equal_conds([a.c2 = b.c1]), other_conds(nil)
4 - output([a.c1], [a.c2]), filter(nil), rowset=256
5 - (#keys=1, [a.c2]), output([a.c1], [a.c2]), filter(nil), rowset=256, dop=2
5 - output([a.c1], [a.c2]), filter(nil), rowset=256
(#keys=1, [a.c2]), dop=2
6 - output([a.c1], [a.c2]), filter(nil), rowset=256
7 - output([a.c1], [a.c2]), filter(nil), rowset=256,
7 - output([a.c1], [a.c2]), filter(nil), rowset=256
access([a.c1], [a.c2]), partitions(p[0-4])
is_index_back=false, is_global_index=false,
range_key([a.c1]), range(MIN ; MAX)always true
8 - output([b.c1]), filter(nil), rowset=256
9 - output([b.c1]), filter(nil), rowset=256,
affinitize
9 - output([b.c1]), filter(nil), rowset=256
access([b.c1]), partitions(p[0-4])
is_index_back=false, is_global_index=false,
range_key([b.c1]), range(MIN ; MAX)always true
select /*+ parallel(2) pq_distribute(a hash hash) NO_USE_HASH_AGGREGATION */ a.c1,a.c2 from t3 a right outer join t3 b on a.c2=b.c1 order by a.c1,a.c2;
+----+------+
| c1 | c2 |
@ -177,23 +189,29 @@ Query Plan
|8 | PX BLOCK ITERATOR | |
|9 | TABLE SCAN |b |
===============================================
Outputs & filters:
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256, sort_keys([a.c1, ASC], [a.c2 + 2, ASC])
1 - output([a.c1], [a.c2 + 2], [INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256, dop=2
2 - output([a.c1], [a.c2 + 2], [a.c2]), filter(nil), rowset=256, sort_keys([a.c1, ASC], [a.c2 + 2, ASC])
3 - output([a.c1], [a.c2]), filter(nil), rowset=256,
0 - output([INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256
sort_keys([a.c1, ASC], [a.c2 + 2, ASC])
1 - output([a.c1], [a.c2 + 2], [INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256
dop=2
2 - output([a.c1], [a.c2 + 2], [a.c2]), filter(nil), rowset=256
sort_keys([a.c1, ASC], [a.c2 + 2, ASC])
3 - output([a.c1], [a.c2 + 2], [a.c2]), filter(nil), rowset=256
equal_conds([a.c2 + 2 = b.c1 + 1]), other_conds(nil)
4 - output([a.c1], [a.c2]), filter(nil), rowset=256
5 - output([a.c1], [a.c2]), filter(nil), rowset=256, dop=2
5 - output([a.c1], [a.c2]), filter(nil), rowset=256
dop=2
6 - output([a.c1], [a.c2]), filter(nil), rowset=256
7 - output([a.c1], [a.c2]), filter(nil), rowset=256,
7 - output([a.c1], [a.c2]), filter(nil), rowset=256
access([a.c1], [a.c2]), partitions(p[0-4])
is_index_back=false, is_global_index=false,
range_key([a.c1]), range(MIN ; MAX)always true
8 - output([b.c1]), filter(nil), rowset=256
9 - output([b.c1]), filter(nil), rowset=256,
9 - output([b.c1]), filter(nil), rowset=256
access([b.c1]), partitions(p[0-4])
is_index_back=false, is_global_index=false,
range_key([b.c1]), range(MIN ; MAX)always true
select /*+ parallel(2) pq_distribute(a hash hash) NO_USE_HASH_AGGREGATION */ a.c1,a.c2 from t3 a right outer join t3 b on a.c2+2=b.c1+1 order by a.c1,a.c2+2;
+----+------+
| c1 | c2 |
@ -223,23 +241,30 @@ Query Plan
|8 | PX PARTITION ITERATOR | |
|9 | TABLE SCAN |b |
============================================
Outputs & filters:
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256, sort_keys([a.c1, ASC], [a.c2 + 2, ASC])
1 - output([a.c1], [a.c2 + 2], [INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256, dop=2
2 - output([a.c1], [a.c2 + 2], [a.c2]), filter(nil), rowset=256, sort_keys([a.c1, ASC], [a.c2 + 2, ASC])
3 - output([a.c1], [a.c2]), filter(nil), rowset=256,
0 - output([INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256
sort_keys([a.c1, ASC], [a.c2 + 2, ASC])
1 - output([a.c1], [a.c2 + 2], [INTERNAL_FUNCTION(a.c1, a.c2)]), filter(nil), rowset=256
dop=2
2 - output([a.c1], [a.c2 + 2], [a.c2]), filter(nil), rowset=256
sort_keys([a.c1, ASC], [a.c2 + 2, ASC])
3 - output([a.c1], [a.c2]), filter(nil), rowset=256
equal_conds([abs(cast(a.c2, BIGINT(-1, 0))) + 2 = b.c1]), other_conds(nil)
4 - output([a.c1], [a.c2], [abs(cast(a.c2, BIGINT(-1, 0))) + 2]), filter(nil), rowset=256
5 - (#keys=1, [abs(cast(a.c2, BIGINT(-1, 0))) + 2]), output([a.c1], [a.c2], [abs(cast(a.c2, BIGINT(-1, 0))) + 2]), filter(nil), rowset=256, dop=2
5 - output([a.c1], [a.c2], [abs(cast(a.c2, BIGINT(-1, 0))) + 2]), filter(nil), rowset=256
(#keys=1, [abs(cast(a.c2, BIGINT(-1, 0))) + 2]), dop=2
6 - output([a.c1], [a.c2]), filter(nil), rowset=256
7 - output([a.c1], [a.c2]), filter(nil), rowset=256,
7 - output([a.c1], [a.c2]), filter(nil), rowset=256
access([a.c1], [a.c2]), partitions(p[0-4])
is_index_back=false, is_global_index=false,
range_key([a.c1]), range(MIN ; MAX)always true
8 - output([b.c1]), filter(nil), rowset=256
9 - output([b.c1]), filter(nil), rowset=256,
affinitize
9 - output([b.c1]), filter(nil), rowset=256
access([b.c1]), partitions(p[0-4])
is_index_back=false, is_global_index=false,
range_key([b.c1]), range(MIN ; MAX)always true
select /*+ parallel(2) pq_distribute(a hash hash) NO_USE_HASH_AGGREGATION */ a.c1,a.c2 from t3 a right outer join t3 b on abs(a.c2)+2=b.c1 order by a.c1,a.c2+2;
+----+------+
| c1 | c2 |
@ -272,23 +297,30 @@ Query Plan
|8 | PX BLOCK ITERATOR | |
|9 | TABLE SCAN |a |
============================================
Outputs & filters:
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(a.c1, a.c2, b.c1, b.c2)]), filter(nil), rowset=256, sort_keys([a.c1, ASC], [b.c1, ASC])
1 - output([a.c1], [b.c1], [INTERNAL_FUNCTION(a.c1, a.c2, b.c1, b.c2)]), filter(nil), rowset=256, dop=2
2 - output([a.c1], [b.c1], [b.c2], [a.c2]), filter(nil), rowset=256, sort_keys([a.c1, ASC], [b.c1, ASC])
3 - output([a.c1], [b.c1], [b.c2], [a.c2]), filter(nil), rowset=256,
0 - output([INTERNAL_FUNCTION(a.c1, a.c2, b.c1, b.c2)]), filter(nil), rowset=256
sort_keys([a.c1, ASC], [b.c1, ASC])
1 - output([a.c1], [b.c1], [INTERNAL_FUNCTION(a.c1, a.c2, b.c1, b.c2)]), filter(nil), rowset=256
dop=2
2 - output([a.c1], [b.c1], [b.c2], [a.c2]), filter(nil), rowset=256
sort_keys([a.c1, ASC], [b.c1, ASC])
3 - output([a.c1], [b.c1], [b.c2], [a.c2]), filter(nil), rowset=256
equal_conds([a.c1 = b.c2]), other_conds(nil)
4 - output([b.c2], [b.c1]), filter(nil), rowset=256
5 - output([b.c2], [b.c1]), filter(nil), rowset=256,
affinitize
5 - output([b.c2], [b.c1]), filter(nil), rowset=256
access([b.c2], [b.c1]), partitions(p[0-5])
is_index_back=false, is_global_index=false,
range_key([b.__pk_increment]), range(MIN ; MAX)always true
6 - output([a.c1], [a.c2]), filter(nil), rowset=256
7 - (#keys=1, [a.c1]), output([a.c1], [a.c2]), filter(nil), rowset=256, dop=2
7 - output([a.c1], [a.c2]), filter(nil), rowset=256
(#keys=1, [a.c1]), dop=2
8 - output([a.c1], [a.c2]), filter(nil), rowset=256
9 - output([a.c1], [a.c2]), filter(nil), rowset=256,
9 - output([a.c1], [a.c2]), filter(nil), rowset=256
access([a.c1], [a.c2]), partitions(p[0-4])
is_index_back=false, is_global_index=false,
range_key([a.__pk_increment]), range(MIN ; MAX)always true
select /*+ parallel(2) pq_distribute(b broadcast none) */ * from t1 a, t2 b where a.c1=b.c2 order by a.c1,b.c1;
+------+------+------+------+
| c1 | c2 | c1 | c2 |
@ -317,23 +349,29 @@ Query Plan
|8 | PX BLOCK ITERATOR | |
|9 | TABLE SCAN |a |
===============================================
Outputs & filters:
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(a.c1, a.c2, b.c1, b.c2)]), filter(nil), rowset=256, sort_keys([a.c1, ASC], [b.c1 + 2, ASC])
1 - output([a.c1], [b.c1 + 2], [INTERNAL_FUNCTION(a.c1, a.c2, b.c1, b.c2)]), filter(nil), rowset=256, dop=2
2 - output([a.c1], [b.c1 + 2], [b.c1], [b.c2], [a.c2]), filter(nil), rowset=256, sort_keys([a.c1, ASC], [b.c1 + 2, ASC])
3 - output([a.c1], [b.c1], [b.c2], [a.c2]), filter(nil), rowset=256,
0 - output([INTERNAL_FUNCTION(a.c1, a.c2, b.c1, b.c2)]), filter(nil), rowset=256
sort_keys([a.c1, ASC], [b.c1 + 2, ASC])
1 - output([a.c1], [b.c1 + 2], [INTERNAL_FUNCTION(a.c1, a.c2, b.c1, b.c2)]), filter(nil), rowset=256
dop=2
2 - output([a.c1], [b.c1 + 2], [b.c1], [b.c2], [a.c2]), filter(nil), rowset=256
sort_keys([a.c1, ASC], [b.c1 + 2, ASC])
3 - output([a.c1], [b.c1], [b.c2], [a.c2]), filter(nil), rowset=256
equal_conds([a.c1 + 2 = b.c2 + 1]), other_conds(nil)
4 - output([b.c1], [b.c2]), filter(nil), rowset=256
5 - output([b.c1], [b.c2]), filter(nil), rowset=256, dop=2
5 - output([b.c1], [b.c2]), filter(nil), rowset=256
dop=2
6 - output([b.c2], [b.c1]), filter(nil), rowset=256
7 - output([b.c2], [b.c1]), filter(nil), rowset=256,
7 - output([b.c2], [b.c1]), filter(nil), rowset=256
access([b.c2], [b.c1]), partitions(p[0-5])
is_index_back=false, is_global_index=false,
range_key([b.__pk_increment]), range(MIN ; MAX)always true
8 - output([a.c1], [a.c2]), filter(nil), rowset=256
9 - output([a.c1], [a.c2]), filter(nil), rowset=256,
9 - output([a.c1], [a.c2]), filter(nil), rowset=256
access([a.c1], [a.c2]), partitions(p[0-4])
is_index_back=false, is_global_index=false,
range_key([a.__pk_increment]), range(MIN ; MAX)always true
select /*+ parallel(2) pq_distribute(b broadcast none) */ * from t1 a, t2 b where a.c1+2=b.c2 + 1 order by a.c1,b.c1+2;
+------+------+------+------+
| c1 | c2 | c1 | c2 |
@ -364,27 +402,34 @@ Query Plan
|11| PX BLOCK ITERATOR | |
|12| TABLE SCAN |b |
=============================================
Outputs & filters:
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(b.c2, T_FUN_SUM(a.c1))]), filter(nil), rowset=256, sort_keys([b.c2, ASC], [T_FUN_SUM(a.c1), ASC])
1 - output([b.c2], [T_FUN_SUM(a.c1)], [INTERNAL_FUNCTION(b.c2, T_FUN_SUM(a.c1))]), filter(nil), rowset=256, dop=2
2 - output([b.c2], [T_FUN_SUM(a.c1)]), filter(nil), rowset=256,
0 - output([INTERNAL_FUNCTION(b.c2, T_FUN_SUM(a.c1))]), filter(nil), rowset=256
sort_keys([b.c2, ASC], [T_FUN_SUM(a.c1), ASC])
1 - output([b.c2], [T_FUN_SUM(a.c1)], [INTERNAL_FUNCTION(b.c2, T_FUN_SUM(a.c1))]), filter(nil), rowset=256
dop=2
2 - output([b.c2], [T_FUN_SUM(a.c1)]), filter(nil), rowset=256
group([b.c2]), agg_func([T_FUN_SUM(a.c1)])
3 - output([b.c2], [a.c1]), filter(nil), rowset=256, sort_keys([b.c2, ASC])
4 - output([b.c2], [a.c1]), filter(nil), rowset=256,
3 - output([b.c2], [a.c1]), filter(nil), rowset=256
sort_keys([b.c2, ASC])
4 - output([b.c2], [a.c1]), filter(nil), rowset=256
equal_conds([a.c1 = b.c2]), other_conds(nil)
5 - output([a.c1]), filter(nil), rowset=256
6 - (#keys=1, [a.c1]), output([a.c1]), filter(nil), rowset=256, dop=2
6 - output([a.c1]), filter(nil), rowset=256
(#keys=1, [a.c1]), dop=2
7 - output([a.c1]), filter(nil), rowset=256
8 - output([a.c1]), filter(nil), rowset=256,
8 - output([a.c1]), filter(nil), rowset=256
access([a.c1]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([a.c1]), range(MIN ; MAX)always true
9 - output([b.c2]), filter(nil), rowset=256
10 - (#keys=1, [b.c2]), output([b.c2]), filter(nil), rowset=256, dop=2
11 - output([b.c2]), filter(nil), rowset=256
12 - output([b.c2]), filter(nil), rowset=256,
10 - output([b.c2]), filter(nil), rowset=256
(#keys=1, [b.c2]), dop=2
11 - output([b.c2]), filter(nil), rowset=256
12 - output([b.c2]), filter(nil), rowset=256
access([b.c2]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([b.c1]), range(MIN ; MAX)always true
select /*+ use_px parallel(2) */ c2,sum(c1) from (select a.c1,b.c2 from t5 a , t5 b where a.c1=b.c2) group by c2 order by 1,2;
+------+---------+
| c2 | sum(c1) |

View File

@ -10,17 +10,15 @@ set @@ob_enable_plan_cache = 0;
// 所有带参数的case表达式都被转为不带参数的case表达式
EXPLAIN select case 1 when 1 then 'a' when 2 then 'b' else 'c' end from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN 1 = 1 THEN 'a' WHEN 1 = 2 THEN 'b' ELSE 'c' END]), filter(nil)
values({CASE WHEN 1 = 1 THEN 'a' WHEN 1 = 2 THEN 'b' ELSE 'c' END})
select case 1 when 1 then 'a' when 2 then 'b' else 'c' end from dual;
+-----------------------------------------------------+
| case 1 when 1 then 'a' when 2 then 'b' else 'c' end |
@ -30,17 +28,15 @@ select case 1 when 1 then 'a' when 2 then 'b' else 'c' end from dual;
// 应该命中else expr
EXPLAIN select case 100 when 1 then 'a' when 2 then 'b' else 'c' end from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN 100 = 1 THEN 'a' WHEN 100 = 2 THEN 'b' ELSE 'c' END]), filter(nil)
values({CASE WHEN 100 = 1 THEN 'a' WHEN 100 = 2 THEN 'b' ELSE 'c' END})
select case 100 when 1 then 'a' when 2 then 'b' else 'c' end from dual;
+-------------------------------------------------------+
| case 100 when 1 then 'a' when 2 then 'b' else 'c' end |
@ -52,17 +48,15 @@ select case 100 when 1 then 'a' when 2 then 'b' else 'c' end from dual;
// 1和'1'的类型不一致,会被加上cast,都被转为decimal再进行比较,返回'a'
EXPLAIN select case 1 when '1' then 'a' when 2 then 'b' else 'c' end from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN cast(1, DECIMAL(1, 0)) = cast('1', DECIMAL(1, -1)) THEN 'a' WHEN 1 = 2 THEN 'b' ELSE 'c' END]), filter(nil)
values({CASE WHEN cast(1, DECIMAL(1, 0)) = cast('1', DECIMAL(1, -1)) THEN 'a' WHEN 1 = 2 THEN 'b' ELSE 'c' END})
select case 1 when '1' then 'a' when 2 then 'b' else 'c' end from dual;
+-------------------------------------------------------+
| case 1 when '1' then 'a' when 2 then 'b' else 'c' end |
@ -72,17 +66,15 @@ select case 1 when '1' then 'a' when 2 then 'b' else 'c' end from dual;
// 第二个then 应该要加cast,返回'a'
EXPLAIN select case 1 when 1 then 'a' when 2 then 'b' else 3 end from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN 1 = 1 THEN 'a' WHEN 1 = 2 THEN 'b' ELSE cast(3, VARCHAR(1048576)) END]), filter(nil)
values({CASE WHEN 1 = 1 THEN 'a' WHEN 1 = 2 THEN 'b' ELSE cast(3, VARCHAR(1048576)) END})
select case 1 when 1 then 'a' when 2 then 'b' else 3 end from dual;
+---------------------------------------------------+
| case 1 when 1 then 'a' when 2 then 'b' else 3 end |
@ -95,17 +87,15 @@ select case 1 when 1 then 'a' when 2 then 'b' else 3 end from dual;
// 应该返回'a'
EXPLAIN select case when 1=1 then 'a' when 2 then 'b' else 'c' end from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN 1 = 1 THEN 'a' WHEN 2 THEN 'b' ELSE 'c' END]), filter(nil)
values({CASE WHEN 1 = 1 THEN 'a' WHEN 2 THEN 'b' ELSE 'c' END})
select case when 1=1 then 'a' when 2 then 'b' else 'c' end from dual;
+-----------------------------------------------------+
| case when 1=1 then 'a' when 2 then 'b' else 'c' end |
@ -115,17 +105,15 @@ select case when 1=1 then 'a' when 2 then 'b' else 'c' end from dual;
// 应该返回'c'
EXPLAIN select case when 0=1 then 'a' when 0.0 then 'b' else 'c' end from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN 0 = 1 THEN 'a' WHEN 0.0 THEN 'b' ELSE 'c' END]), filter(nil)
values({CASE WHEN 0 = 1 THEN 'a' WHEN 0.0 THEN 'b' ELSE 'c' END})
select case when 0=1 then 'a' when 0.0 then 'b' else 'c' end from dual;
+-------------------------------------------------------+
| case when 0=1 then 'a' when 0.0 then 'b' else 'c' end |
@ -136,17 +124,15 @@ select case when 0=1 then 'a' when 0.0 then 'b' else 'c' end from dual;
// 应该返回'a',且0='1'中要加cast
EXPLAIN select case when 1='1' then 'a' when 2 then 'b' else 'c' end from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN cast(1, DECIMAL(1, 0)) = cast('1', DECIMAL(1, -1)) THEN 'a' WHEN 2 THEN 'b' ELSE 'c' END]), filter(nil)
values({CASE WHEN cast(1, DECIMAL(1, 0)) = cast('1', DECIMAL(1, -1)) THEN 'a' WHEN 2 THEN 'b' ELSE 'c' END})
select case when 1='1' then 'a' when 2 then 'b' else 'c' end from dual;
+-------------------------------------------------------+
| case when 1='1' then 'a' when 2 then 'b' else 'c' end |
@ -156,17 +142,15 @@ select case when 1='1' then 'a' when 2 then 'b' else 'c' end from dual;
// 应该返回'c',且0='1'中要加cast
EXPLAIN select case when 0='1' then 'a' when 0.0 then 'b' else 'c' end from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN cast(0, DECIMAL(1, 0)) = cast('1', DECIMAL(1, -1)) THEN 'a' WHEN 0.0 THEN 'b' ELSE 'c' END]), filter(nil)
values({CASE WHEN cast(0, DECIMAL(1, 0)) = cast('1', DECIMAL(1, -1)) THEN 'a' WHEN 0.0 THEN 'b' ELSE 'c' END})
select case when 0='1' then 'a' when 0.0 then 'b' else 'c' end from dual;
+---------------------------------------------------------+
| case when 0='1' then 'a' when 0.0 then 'b' else 'c' end |
@ -186,17 +170,17 @@ alter system flush plan cache global;
// 测试int的normal case,应该返回'a'
EXPLAIN select case col_int when 1 then 'a' when 2 then 'b' else 'c' end from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN t1.col_int = 1 THEN 'a' WHEN t1.col_int = 2 THEN 'b' ELSE 'c' END]), filter(nil), rowset=256,
0 - output([CASE WHEN t1.col_int = 1 THEN 'a' WHEN t1.col_int = 2 THEN 'b' ELSE 'c' END]), filter(nil), rowset=256
access([t1.col_int]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select case col_int when 1 then 'a' when 2 then 'b' else 'c' end from t1;
+-----------------------------------------------------------+
| case col_int when 1 then 'a' when 2 then 'b' else 'c' end |
@ -206,17 +190,18 @@ select case col_int when 1 then 'a' when 2 then 'b' else 'c' end from t1;
// 测试int需要加cast的情况,第一个when需要加cast, 第二个when不需要
EXPLAIN select case col_int when '1' then 'a' when 2 then 'b' else 'c' end from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN cast(t1.col_int, DECIMAL(11, 0)) = cast('1', DECIMAL(1, -1)) THEN 'a' WHEN t1.col_int = 2 THEN 'b' ELSE 'c' END]), filter(nil), rowset=256,
0 - output([CASE WHEN cast(t1.col_int, DECIMAL(11, 0)) = cast('1', DECIMAL(1, -1)) THEN 'a' WHEN t1.col_int = 2 THEN 'b' ELSE 'c' END]), filter(nil),
rowset=256
access([t1.col_int]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select case col_int when '1' then 'a' when 2 then 'b' else 'c' end from t1;
+-------------------------------------------------------------+
| case col_int when '1' then 'a' when 2 then 'b' else 'c' end |
@ -226,17 +211,17 @@ select case col_int when '1' then 'a' when 2 then 'b' else 'c' end from t1;
// 测试null的情况,应该返回'c',而且没有cast出现
EXPLAIN select case col_null when 1 then 'a' when 2 then 'b' else 'c' end from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN t1.col_null = 1 THEN 'a' WHEN t1.col_null = 2 THEN 'b' ELSE 'c' END]), filter(nil), rowset=256,
0 - output([CASE WHEN t1.col_null = 1 THEN 'a' WHEN t1.col_null = 2 THEN 'b' ELSE 'c' END]), filter(nil), rowset=256
access([t1.col_null]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select case col_null when 1 then 'a' when 2 then 'b' else 'c' end from t1;
+------------------------------------------------------------+
| case col_null when 1 then 'a' when 2 then 'b' else 'c' end |
@ -248,17 +233,15 @@ select case col_null when 1 then 'a' when 2 then 'b' else 'c' end from t1;
// 应该返回1, MySQL没有把空串看成NULL
EXPLAIN select case '' when '' then 1 when 'here' then 2 else 'hh' end from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN '' = '' THEN cast(1, VARCHAR(1048576)) WHEN '' = 'here' THEN cast(2, VARCHAR(1048576)) ELSE 'hh' END]), filter(nil)
values({CASE WHEN '' = '' THEN cast(1, VARCHAR(1048576)) WHEN '' = 'here' THEN cast(2, VARCHAR(1048576)) ELSE 'hh' END})
select case '' when '' then 1 when 'here' then 2 else 'hh' end from dual;
+---------------------------------------------------------+
| case '' when '' then 1 when 'here' then 2 else 'hh' end |
@ -268,17 +251,16 @@ select case '' when '' then 1 when 'here' then 2 else 'hh' end from dual;
// 应该返回'hh'
EXPLAIN select case NULL when NULL then 1 when 'here' then 2 else 'hh' end from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN NULL = NULL THEN cast(1, VARCHAR(1048576)) WHEN cast(NULL, VARCHAR(1048576)) = 'here' THEN cast(2, VARCHAR(1048576)) ELSE 'hh' END]), filter(nil)
0 - output([CASE WHEN NULL = NULL THEN cast(1, VARCHAR(1048576)) WHEN cast(NULL, VARCHAR(1048576)) = 'here' THEN cast(2, VARCHAR(1048576)) ELSE 'hh' END]),
filter(nil)
values({CASE WHEN NULL = NULL THEN cast(1, VARCHAR(1048576)) WHEN cast(NULL, VARCHAR(1048576)) = 'here' THEN cast(2, VARCHAR(1048576)) ELSE 'hh' END})
select case NULL when NULL then 1 when 'here' then 2 else 'hh' end from dual;
+-------------------------------------------------------------+
| case NULL when NULL then 1 when 'here' then 2 else 'hh' end |
@ -288,17 +270,15 @@ select case NULL when NULL then 1 when 'here' then 2 else 'hh' end from dual;
// 应该返回1, MySQL没有把空串看成NULL
EXPLAIN select case when '' = '' then 1 when 'here' then 2 else 'hh' end from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN '' = '' THEN cast(1, VARCHAR(1048576)) WHEN cast('here', DOUBLE(-1, -1)) THEN cast(2, VARCHAR(1048576)) ELSE 'hh' END]), filter(nil)
values({CASE WHEN '' = '' THEN cast(1, VARCHAR(1048576)) WHEN cast('here', DOUBLE(-1, -1)) THEN cast(2, VARCHAR(1048576)) ELSE 'hh' END})
select case when '' = '' then 1 when 'here' then 2 else 'hh' end from dual;
+-----------------------------------------------------------+
| case when '' = '' then 1 when 'here' then 2 else 'hh' end |
@ -308,17 +288,15 @@ select case when '' = '' then 1 when 'here' then 2 else 'hh' end from dual;
// 应该返回'hh', 因为'here'cast为double会失败,返回值应该是0
EXPLAIN select case when NULL=NULL then 1 when 'here' then 2 else 'hh' end from dual;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |EXPRESSION| |1 |1 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |EXPRESSION| |1 |1 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN NULL = NULL THEN cast(1, VARCHAR(1048576)) WHEN cast('here', DOUBLE(-1, -1)) THEN cast(2, VARCHAR(1048576)) ELSE 'hh' END]), filter(nil)
values({CASE WHEN NULL = NULL THEN cast(1, VARCHAR(1048576)) WHEN cast('here', DOUBLE(-1, -1)) THEN cast(2, VARCHAR(1048576)) ELSE 'hh' END})
select case when NULL=NULL then 1 when 'here' then 2 else 'hh' end from dual;
+-------------------------------------------------------------+
| case when NULL=NULL then 1 when 'here' then 2 else 'hh' end |
@ -333,37 +311,37 @@ drop table t1;
create table t1 (a varchar(100) collate utf8_general_ci, cond1 varchar(100) collate utf8_bin, cond2 varchar(100) collate utf8_general_ci);
EXPLAIN insert into t1 values('cond', 'COND', 'COND');
Query Plan
===========================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-------------------------------------------
|0 |DISTRIBUTED INSERT| |1 |13 |
|1 | EXPRESSION | |1 |1 |
===========================================
Outputs & filters:
==================================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
--------------------------------------------------
|0 |DISTRIBUTED INSERT| |1 |13 |
|1 | EXPRESSION | |1 |1 |
==================================================
Outputs & filters:
-------------------------------------
0 - output(nil), filter(nil),
0 - output(nil), filter(nil)
columns([{t1: ({t1: (t1.__pk_increment, t1.a, t1.cond1, t1.cond2)})}]),
column_values([T_HIDDEN_PK], [column_conv(VARCHAR,utf8mb4_general_ci,length:100,NULL,__values.a)], [column_conv(VARCHAR,utf8mb4_bin,length:100,NULL,__values.cond1)], [column_conv(VARCHAR,utf8mb4_general_ci,length:100,NULL,__values.cond2)])
column_values([T_HIDDEN_PK], [column_conv(VARCHAR,utf8mb4_general_ci,length:100,NULL,__values.a)], [column_conv(VARCHAR,utf8mb4_bin,length:100,NULL,__values.cond1)],
[column_conv(VARCHAR,utf8mb4_general_ci,length:100,NULL,__values.cond2)])
1 - output([__values.a], [__values.cond1], [__values.cond2]), filter(nil)
values({'cond', 'COND', 'COND'})
insert into t1 values('cond', 'COND', 'COND');
explain_protocol: 2
// 返回Null,a和cond1以及a和cond2比较都会使用utf8_bin作为collation type(因为有aggregate collation的过程)
EXPLAIN select case a when cond1 then '1' when cond2 then '2' end from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN cast(t1.a, VARCHAR(1048576)) = t1.cond1 THEN '1' WHEN cast(t1.a, VARCHAR(1048576)) = cast(t1.cond2, VARCHAR(1048576)) THEN '2' ELSE NULL END]), filter(nil), rowset=256,
0 - output([CASE WHEN cast(t1.a, VARCHAR(1048576)) = t1.cond1 THEN '1' WHEN cast(t1.a, VARCHAR(1048576)) = cast(t1.cond2, VARCHAR(1048576)) THEN '2' ELSE
NULL END]), filter(nil), rowset=256
access([t1.a], [t1.cond1], [t1.cond2]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select case a when cond1 then '1' when cond2 then '2' end from t1;
+----------------------------------------------------+
| case a when cond1 then '1' when cond2 then '2' end |
@ -373,17 +351,17 @@ select case a when cond1 then '1' when cond2 then '2' end from t1;
// 返回'neq', a和cond1比较使用的是utf8_bin
EXPLAIN select case a when cond1 then 'eq' else 'neq' end from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN cast(t1.a, VARCHAR(1048576)) = t1.cond1 THEN 'eq' ELSE 'neq' END]), filter(nil), rowset=256,
0 - output([CASE WHEN cast(t1.a, VARCHAR(1048576)) = t1.cond1 THEN 'eq' ELSE 'neq' END]), filter(nil), rowset=256
access([t1.a], [t1.cond1]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select case a when cond1 then 'eq' else 'neq' end from t1;
+--------------------------------------------+
| case a when cond1 then 'eq' else 'neq' end |
@ -393,17 +371,17 @@ select case a when cond1 then 'eq' else 'neq' end from t1;
// 返回'eq', a和cond1比较使用的是utf8_general_ci
EXPLAIN select case a when cond2 then 'eq' else 'neq' end from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN t1.a = t1.cond2 THEN 'eq' ELSE 'neq' END]), filter(nil), rowset=256,
0 - output([CASE WHEN t1.a = t1.cond2 THEN 'eq' ELSE 'neq' END]), filter(nil), rowset=256
access([t1.a], [t1.cond2]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select case a when cond2 then 'eq' else 'neq' end from t1;
+--------------------------------------------+
| case a when cond2 then 'eq' else 'neq' end |
@ -413,17 +391,17 @@ select case a when cond2 then 'eq' else 'neq' end from t1;
// arg case子节点也是arg case的情况测试,应该都被改为case expr(应该返回'ok')
EXPLAIN select case case a when 'cond' then 'eq' else 'neq' end when 'eq' then 'ok' else 'not ok' end from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([CASE WHEN CASE WHEN t1.a = 'cond' THEN 'eq' ELSE 'neq' END = 'eq' THEN 'ok' ELSE 'not ok' END]), filter(nil), rowset=256,
0 - output([CASE WHEN CASE WHEN t1.a = 'cond' THEN 'eq' ELSE 'neq' END = 'eq' THEN 'ok' ELSE 'not ok' END]), filter(nil), rowset=256
access([t1.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select case case a when 'cond' then 'eq' else 'neq' end when 'eq' then 'ok' else 'not ok' end from t1;
+----------------------------------------------------------------------------------------+
| case case a when 'cond' then 'eq' else 'neq' end when 'eq' then 'ok' else 'not ok' end |

View File

@ -14,26 +14,26 @@ set @@ob_enable_plan_cache = 0;
explain select c2, sum(c1) from (select distinct c2, c1 from t1) x group by c2;
Query Plan
========================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
----------------------------------------
|0 |HASH GROUP BY | |5 |5 |
|1 | SUBPLAN SCAN |x |5 |4 |
|2 | HASH DISTINCT| |5 |4 |
|3 | TABLE SCAN |t1 |5 |2 |
========================================
Outputs & filters:
===============================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-----------------------------------------------
|0 |HASH GROUP BY | |5 |5 |
|1 | SUBPLAN SCAN |x |5 |4 |
|2 | HASH DISTINCT| |5 |4 |
|3 | TABLE SCAN |t1 |5 |2 |
===============================================
Outputs & filters:
-------------------------------------
0 - output([x.c2], [T_FUN_SUM(x.c1)]), filter(nil), rowset=256,
0 - output([x.c2], [T_FUN_SUM(x.c1)]), filter(nil), rowset=256
group([x.c2]), agg_func([T_FUN_SUM(x.c1)])
1 - output([x.c2], [x.c1]), filter(nil), rowset=256,
1 - output([x.c2], [x.c1]), filter(nil), rowset=256
access([x.c2], [x.c1])
2 - output([t1.c2], [t1.c1]), filter(nil), rowset=256,
2 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
distinct([t1.c2], [t1.c1])
3 - output([t1.c2], [t1.c1]), filter(nil), rowset=256,
3 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
access([t1.c2], [t1.c1]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select c2, sum(c1) from (select distinct c2, c1 from t1) x group by c2;
+------+---------+
| c2 | sum(c1) |
@ -45,26 +45,26 @@ select c2, sum(c1) from (select distinct c2, c1 from t1) x group by c2;
explain select c2, sum(c1 + c2) from (select distinct c2, c1 from t1) x group by c2;
Query Plan
========================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
----------------------------------------
|0 |HASH GROUP BY | |5 |5 |
|1 | SUBPLAN SCAN |x |5 |4 |
|2 | HASH DISTINCT| |5 |4 |
|3 | TABLE SCAN |t1 |5 |2 |
========================================
Outputs & filters:
===============================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-----------------------------------------------
|0 |HASH GROUP BY | |5 |5 |
|1 | SUBPLAN SCAN |x |5 |4 |
|2 | HASH DISTINCT| |5 |4 |
|3 | TABLE SCAN |t1 |5 |2 |
===============================================
Outputs & filters:
-------------------------------------
0 - output([x.c2], [T_FUN_SUM(x.c1 + x.c2)]), filter(nil), rowset=256,
0 - output([x.c2], [T_FUN_SUM(x.c1 + x.c2)]), filter(nil), rowset=256
group([x.c2]), agg_func([T_FUN_SUM(x.c1 + x.c2)])
1 - output([x.c2], [x.c1]), filter(nil), rowset=256,
1 - output([x.c2], [x.c1]), filter(nil), rowset=256
access([x.c2], [x.c1])
2 - output([t1.c2], [t1.c1]), filter(nil), rowset=256,
2 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
distinct([t1.c2], [t1.c1])
3 - output([t1.c2], [t1.c1]), filter(nil), rowset=256,
3 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
access([t1.c2], [t1.c1]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select c2, sum(c1 + c2) from (select distinct c2, c1 from t1) x group by c2;
+------+--------------+
| c2 | sum(c1 + c2) |
@ -76,26 +76,26 @@ select c2, sum(c1 + c2) from (select distinct c2, c1 from t1) x group by c2;
explain select c2, sum(c1 + c2), max(c3) from (select c1, c2, c1 + 2 as c3 from (select distinct c2, c1 from t1) x ) y group by c2;
Query Plan
========================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
----------------------------------------
|0 |HASH GROUP BY | |5 |5 |
|1 | SUBPLAN SCAN |x |5 |4 |
|2 | HASH DISTINCT| |5 |4 |
|3 | TABLE SCAN |t1 |5 |2 |
========================================
Outputs & filters:
===============================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-----------------------------------------------
|0 |HASH GROUP BY | |5 |5 |
|1 | SUBPLAN SCAN |x |5 |4 |
|2 | HASH DISTINCT| |5 |4 |
|3 | TABLE SCAN |t1 |5 |2 |
===============================================
Outputs & filters:
-------------------------------------
0 - output([x.c2], [T_FUN_SUM(x.c1 + x.c2)], [T_FUN_MAX(x.c1 + 2)]), filter(nil), rowset=256,
0 - output([x.c2], [T_FUN_SUM(x.c1 + x.c2)], [T_FUN_MAX(x.c1 + 2)]), filter(nil), rowset=256
group([x.c2]), agg_func([T_FUN_SUM(x.c1 + x.c2)], [T_FUN_MAX(x.c1 + 2)])
1 - output([x.c1], [x.c2]), filter(nil), rowset=256,
1 - output([x.c1], [x.c2]), filter(nil), rowset=256
access([x.c1], [x.c2])
2 - output([t1.c2], [t1.c1]), filter(nil), rowset=256,
2 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
distinct([t1.c2], [t1.c1])
3 - output([t1.c2], [t1.c1]), filter(nil), rowset=256,
3 - output([t1.c2], [t1.c1]), filter(nil), rowset=256
access([t1.c2], [t1.c1]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select c2, sum(c1 + c2), max(c3) from (select c1, c2, c1 + 2 as c3 from (select distinct c2, c1 from t1) x ) y group by c2;
+------+--------------+---------+
| c2 | sum(c1 + c2) | max(c3) |
@ -107,17 +107,17 @@ select c2, sum(c1 + c2), max(c3) from (select c1, c2, c1 + 2 as c3 from (select
explain select * from t1 where c2 in (select 1 from t1);
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |1 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2]), filter([t1.c2 = 1]), rowset=256,
0 - output([t1.c1], [t1.c2]), filter([t1.c2 = 1]), rowset=256
access([t1.c2], [t1.c1]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
select * from t1 where c2 in (select 1 from t1);
+------+------+
| c1 | c2 |

View File

@ -23,17 +23,19 @@ insert into t1 values('3', '1', '1', '1', '-1', '6', '7', '8', '9', '10', '-11',
explain_protocol: 2
EXPLAIN select * from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |4 |4 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |4 |4 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10], [t1.c11], [t1.c12], [t1.c13], [t1.c14], [t1.c15], [t1.c16], [t1.c17], [t1.c18], [t1.c19], [t1.c20], [t1.c21], [t1.c22]), filter(nil), rowset=256,
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10], [t1.c11], [t1.c12], [t1.c13], [t1.c14], [t1.c15], [t1.c16], [t1.c17], [t1.c18], [t1.c19], [t1.c20], [t1.c21], [t1.c22]), partitions(p0)
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10], [t1.c11], [t1.c12], [t1.c13], [t1.c14], [t1.c15],
[t1.c16], [t1.c17], [t1.c18], [t1.c19], [t1.c20], [t1.c21], [t1.c22]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5], [t1.c6], [t1.c7], [t1.c8], [t1.c9], [t1.c10], [t1.c11], [t1.c12], [t1.c13], [t1.c14], [t1.c15],
[t1.c16], [t1.c17], [t1.c18], [t1.c19], [t1.c20], [t1.c21], [t1.c22]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.c1]), range(MIN ; MAX)always true
select * from t1;
+----+------+------+------+------+------+------+------+------+------+------+------+--------+-------+---------+--------+------+------+---------------------+---------------------+------------+---------+
| c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8 | c9 | c10 | c11 | c12 | c13 | c14 | c15 | c16 | c17 | c18 | c19 | c20 | c21 | c22 |

View File

@ -20,17 +20,17 @@ set @@ob_enable_plan_cache = 0;
explain_protocol: 2
EXPLAIN select * from t1;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |7 |3 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |7 |3 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.c2]), range(MIN,MIN ; MAX,MAX)always true
select * from t1;
+----+----+------+------+------------+
| c1 | c2 | c3 | c4 | c5 |
@ -45,17 +45,17 @@ select * from t1;
+----+----+------+------+------------+
EXPLAIN select * from t1 order by c1 desc, c2 desc;
Query Plan
==========================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
------------------------------------------
|0 |TABLE SCAN|t1(Reverse)|7 |3 |
==========================================
Outputs & filters:
=================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-------------------------------------------------
|0 |TABLE SCAN|t1(Reverse)|7 |3 |
=================================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.c2]), range(MIN,MIN ; MAX,MAX)always true
select * from t1 order by c1 desc, c2 desc;
+----+----+------+------+------------+
| c1 | c2 | c3 | c4 | c5 |
@ -70,17 +70,17 @@ select * from t1 order by c1 desc, c2 desc;
+----+----+------+------+------------+
EXPLAIN select * from t1 where c1 + c2 < 10;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |3 |3 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |3 |3 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter([t1.c1 + t1.c2 < cast(10, DECIMAL(2, 0))]), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter([t1.c1 + t1.c2 < cast(10, DECIMAL(2, 0))]), rowset=256
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([t1.c1], [t1.c2]), range(MIN,MIN ; MAX,MAX)always true
select * from t1 where c1 + c2 < 10;
+----+----+------+------+------------+
| c1 | c2 | c3 | c4 | c5 |
@ -92,18 +92,17 @@ select * from t1 where c1 + c2 < 10;
+----+----+------+------+------------+
EXPLAIN select * from t1 limit 2;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |2 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |2 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter(nil), rowset=256,
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), partitions(p0),
limit(2), offset(nil)
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), partitions(p0)
limit(2), offset(nil), is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.c2]), range(MIN,MIN ; MAX,MAX)always true
select * from t1 limit 2;
+----+----+------+------+------------+
| c1 | c2 | c3 | c4 | c5 |
@ -113,17 +112,18 @@ select * from t1 limit 2;
+----+----+------+------+------------+
EXPLAIN select * from t1 where c1 = 5;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |2 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |2 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.c2]), range(5,MIN ; 5,MAX),
range_cond([t1.c1 = cast(5, DECIMAL(1, 0))])
select * from t1 where c1 = 5;
+----+----+------+------+------------+
| c1 | c2 | c3 | c4 | c5 |
@ -133,17 +133,18 @@ select * from t1 where c1 = 5;
+----+----+------+------+------------+
EXPLAIN select * from t1 where c1 = 5 or c1 = 7;
Query Plan
===================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------
|0 |TABLE SCAN|t1 |4 |2 |
===================================
Outputs & filters:
==========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
------------------------------------------
|0 |TABLE SCAN|t1 |4 |2 |
==========================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.c2]), range(5,MIN ; 5,MAX), (7,MIN ; 7,MAX),
range_cond([t1.c1 = cast(5, DECIMAL(1, 0)) OR t1.c1 = cast(7, DECIMAL(1, 0))])
select * from t1 where c1 = 5 or c1 = 7;
+----+----+------+------+------------+
| c1 | c2 | c3 | c4 | c5 |
@ -155,17 +156,19 @@ select * from t1 where c1 = 5 or c1 = 7;
+----+----+------+------+------------+
EXPLAIN select * from t1 where (c1 = 2 and c2 = 4) or (c1 = 7 and c2 = 5) or (c1 = 8 and c2 = 7);
Query Plan
==================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
----------------------------------
|0 |TABLE GET|t1 |3 |8 |
==================================
Outputs & filters:
=========================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-----------------------------------------
|0 |TABLE GET|t1 |3 |8 |
=========================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter(nil), rowset=256
access([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.c1], [t1.c2]), range[2,4 ; 2,4], [7,5 ; 7,5], [8,7 ; 8,7],
range_cond([(T_OP_OR, t1.c1 = cast(2, DECIMAL(1, 0)) AND t1.c2 = cast(4, DECIMAL(1, 0)), t1.c1 = cast(7, DECIMAL(1, 0)) AND t1.c2 = cast(5, DECIMAL(1,
0)), t1.c1 = cast(8, DECIMAL(1, 0)) AND t1.c2 = cast(7, DECIMAL(1, 0)))])
select * from t1 where (c1 = 2 and c2 = 4) or (c1 = 7 and c2 = 5) or (c1 = 8 and c2 = 7);
+----+----+------+------+------------+
| c1 | c2 | c3 | c4 | c5 |
@ -176,17 +179,19 @@ select * from t1 where (c1 = 2 and c2 = 4) or (c1 = 7 and c2 = 5) or (c1 = 8 and
EXPLAIN select * from t1 where c2 = 2 and c1 + c2 < 10 and c4 > c3;
Query Plan
=====================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------
|0 |TABLE SCAN|t1(i1)|1 |4 |
============================================
Outputs & filters:
-------------------------------------
|0 |TABLE SCAN|t1(i1)|1 |4 |
=====================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter([t1.c1 + cast(cast(2, DECIMAL(1, 0)), DECIMAL(10, 0)) < cast(10, DECIMAL(2, 0))], [t1.c4 > t1.c3]), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3], [t1.c4], [t1.c5]), filter([t1.c1 + cast(cast(2, DECIMAL(1, 0)), DECIMAL(10, 0)) < cast(10, DECIMAL(2, 0))], [t1.c4
> t1.c3]), rowset=256
access([t1.c1], [t1.c2], [t1.c4], [t1.c3], [t1.c5]), partitions(p0)
is_index_back=true, is_global_index=false, filter_before_indexback[true,false],
range_key([t1.c2], [t1.c1]), range(2,MIN ; 2,MAX),
range_cond([t1.c2 = cast(2, DECIMAL(1, 0))])
select * from t1 where c2 = 2 and c1 + c2 < 10 and c4 > c3;
+----+----+------+------+------------+
| c1 | c2 | c3 | c4 | c5 |
@ -197,17 +202,18 @@ select * from t1 where c2 = 2 and c1 + c2 < 10 and c4 > c3;
EXPLAIN select c1, c2 from t1 where c2 > 4;
Query Plan
=====================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------
|0 |TABLE SCAN|t1(i1)|3 |2 |
============================================
Outputs & filters:
-------------------------------------
|0 |TABLE SCAN|t1(i1)|3 |2 |
=====================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2]), filter(nil), rowset=256,
0 - output([t1.c1], [t1.c2]), filter(nil), rowset=256
access([t1.c1], [t1.c2]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t1.c2], [t1.c1]), range(4,MAX ; MAX,MAX),
range_cond([t1.c2 > cast(4, DECIMAL(1, 0))])
select c1, c2 from t1 where c2 > 4;
+----+----+
| c1 | c2 |
@ -222,38 +228,37 @@ drop table t1;
create table t1(c1 int primary key, c2 int, c3 int, index idx(c2));
EXPLAIN insert into t1 values(1,1,1), (2,2,2), (3,3,3), (4,4,4),(5,5,5), (6,6,6), (7,7,7);
Query Plan
===========================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-------------------------------------------
|0 |DISTRIBUTED INSERT| |7 |51 |
|1 | EXPRESSION | |7 |1 |
===========================================
Outputs & filters:
==================================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
--------------------------------------------------
|0 |DISTRIBUTED INSERT| |7 |51 |
|1 | EXPRESSION | |7 |1 |
==================================================
Outputs & filters:
-------------------------------------
0 - output(nil), filter(nil),
0 - output(nil), filter(nil)
columns([{t1: ({t1: (t1.c1, t1.c2, t1.c3)})}]),
column_values([column_conv(INT,PS:(11,0),NOT NULL,__values.c1)], [column_conv(INT,PS:(11,0),NULL,__values.c2)], [column_conv(INT,PS:(11,0),NULL,__values.c3)])
1 - output([__values.c1], [__values.c2], [__values.c3]), filter(nil)
values({1, 1, 1}, {2, 2, 2}, {3, 3, 3}, {4, 4, 4}, {5, 5, 5}, {6, 6, 6}, {7, 7, 7})
insert into t1 values(1,1,1), (2,2,2), (3,3,3), (4,4,4),(5,5,5), (6,6,6), (7,7,7);
# case 1: index back with before_index_back_filter
EXPLAIN select /*+index(t1 idx)*/ c1, c2, c3 from t1 where c2 > 1 and c1 < 4;
Query Plan
======================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
--------------------------------------
|0 |TABLE SCAN|t1(idx)|1 |4 |
======================================
Outputs & filters:
=============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
---------------------------------------------
|0 |TABLE SCAN|t1(idx)|1 |4 |
=============================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3]), filter([t1.c1 < 4]), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3]), filter([t1.c1 < 4]), rowset=256
access([t1.c1], [t1.c2], [t1.c3]), partitions(p0)
is_index_back=true, is_global_index=false, filter_before_indexback[true],
range_key([t1.c2], [t1.c1]), range(1,MAX ; MAX,4),
range_cond([t1.c2 > 1])
select /*+index(t1 idx)*/ c1, c2, c3 from t1 where c2 > 1 and c1 < 4;
+----+------+------+
| c1 | c2 | c3 |
@ -266,17 +271,18 @@ select /*+index(t1 idx)*/ c1, c2, c3 from t1 where c2 > 1 and c1 < 4;
# case 2: index back without before_index_back_filter
EXPLAIN select /*+index(t1 idx)*/ c1, c2, c3 from t1 where c2 > 1 and c3 < 4;
Query Plan
======================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
--------------------------------------
|0 |TABLE SCAN|t1(idx)|1 |18 |
======================================
Outputs & filters:
=============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
---------------------------------------------
|0 |TABLE SCAN|t1(idx)|1 |18 |
=============================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3]), filter([t1.c3 < 4]), rowset=256,
0 - output([t1.c1], [t1.c2], [t1.c3]), filter([t1.c3 < 4]), rowset=256
access([t1.c1], [t1.c2], [t1.c3]), partitions(p0)
is_index_back=true, is_global_index=false, filter_before_indexback[false],
range_key([t1.c2], [t1.c1]), range(1,MAX ; MAX,MAX),
range_cond([t1.c2 > 1])
select /*+index(t1 idx)*/ c1, c2, c3 from t1 where c2 > 1 and c3 < 4;
+----+------+------+
| c1 | c2 | c3 |
@ -287,18 +293,17 @@ select /*+index(t1 idx)*/ c1, c2, c3 from t1 where c2 > 1 and c3 < 4;
EXPLAIN select /*+index(t1 idx)*/ c1, c2, c3 from t1 where c3 != 1 limit 2;
Query Plan
======================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
--------------------------------------
|0 |TABLE SCAN|t1(idx)|2 |8 |
======================================
Outputs & filters:
=============================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
---------------------------------------------
|0 |TABLE SCAN|t1(idx)|2 |8 |
=============================================
Outputs & filters:
-------------------------------------
0 - output([t1.c1], [t1.c2], [t1.c3]), filter([t1.c3 != 1]), rowset=256,
access([t1.c1], [t1.c3], [t1.c2]), partitions(p0),
limit(2), offset(nil)
0 - output([t1.c1], [t1.c2], [t1.c3]), filter([t1.c3 != 1]), rowset=256
access([t1.c1], [t1.c3], [t1.c2]), partitions(p0)
limit(2), offset(nil), is_index_back=true, is_global_index=false, filter_before_indexback[false],
range_key([t1.c2], [t1.c1]), range(MIN,MIN ; MAX,MAX)always true
select /*+index(t1 idx)*/ c1, c2, c3 from t1 where c3 != 1 limit 2;
+----+------+------+
| c1 | c2 | c3 |

View File

@ -32,23 +32,25 @@ a b
9 5
explain select * from t2 where b in (select a from t1);
Query Plan
=============================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
---------------------------------------------
|0 |HASH RIGHT SEMI JOIN| |3 |6 |
|1 | TABLE SCAN |t1 |3 |2 |
|2 | TABLE SCAN |t2 |10 |3 |
=============================================
Outputs & filters:
=====================================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-----------------------------------------------------
|0 |HASH RIGHT SEMI JOIN | |3 |6 |
|1 | TABLE SCAN |t1 |3 |2 |
|2 | TABLE SCAN |t2 |10 |3 |
=====================================================
Outputs & filters:
-------------------------------------
0 - output([t2.a], [t2.b]), filter(nil), rowset=256,
0 - output([t2.a], [t2.b]), filter(nil), rowset=256
equal_conds([t2.b = t1.a]), other_conds(nil)
1 - output([t1.a]), filter(nil), rowset=256,
1 - output([t1.a]), filter(nil), rowset=256
access([t1.a]), partitions(p0)
2 - output([t2.b], [t2.a]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
2 - output([t2.b], [t2.a]), filter(nil), rowset=256
access([t2.b], [t2.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.__pk_increment]), range(MIN ; MAX)always true
select * from t2 where b in (select a from t1);
a b
1 1
@ -65,23 +67,25 @@ primary key(pk1, pk2, pk3)
insert into t3 select a,a, a,a,a from t0;
explain select * from t3 where b in (select a from t1);
Query Plan
=============================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
---------------------------------------------
|0 |HASH RIGHT SEMI JOIN| |3 |6 |
|1 | TABLE SCAN |t1 |3 |2 |
|2 | TABLE SCAN |t3 |10 |3 |
=============================================
Outputs & filters:
=====================================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-----------------------------------------------------
|0 |HASH RIGHT SEMI JOIN | |3 |6 |
|1 | TABLE SCAN |t1 |3 |2 |
|2 | TABLE SCAN |t3 |10 |3 |
=====================================================
Outputs & filters:
-------------------------------------
0 - output([t3.a], [t3.b], [t3.pk1], [t3.pk2], [t3.pk3]), filter(nil), rowset=256,
0 - output([t3.a], [t3.b], [t3.pk1], [t3.pk2], [t3.pk3]), filter(nil), rowset=256
equal_conds([t3.b = t1.a]), other_conds(nil)
1 - output([t1.a]), filter(nil), rowset=256,
1 - output([t1.a]), filter(nil), rowset=256
access([t1.a]), partitions(p0)
2 - output([t3.pk1], [t3.pk2], [t3.pk3], [t3.b], [t3.a]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
2 - output([t3.pk1], [t3.pk2], [t3.pk3], [t3.b], [t3.a]), filter(nil), rowset=256
access([t3.pk1], [t3.pk2], [t3.pk3], [t3.b], [t3.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t3.pk1], [t3.pk2], [t3.pk3]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
select * from t3 where b in (select a from t1);
a b pk1 pk2 pk3
1 1 1 1 1
@ -99,23 +103,25 @@ A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a
from t0 A, t0 B where B.a <5;
explain select * from t3 where b in (select a from t0);
Query Plan
=============================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
---------------------------------------------
|0 |HASH RIGHT SEMI JOIN| |10 |15 |
|1 | TABLE SCAN |t0 |10 |3 |
|2 | TABLE SCAN |t3 |50 |7 |
=============================================
Outputs & filters:
=====================================================
|ID|OPERATOR |NAME|EST.ROWS|EST.TIME(us)|
-----------------------------------------------------
|0 |HASH RIGHT SEMI JOIN | |10 |15 |
|1 | TABLE SCAN |t0 |10 |3 |
|2 | TABLE SCAN |t3 |50 |7 |
=====================================================
Outputs & filters:
-------------------------------------
0 - output([t3.a], [t3.b], [t3.pk1], [t3.pk2]), filter(nil), rowset=256,
0 - output([t3.a], [t3.b], [t3.pk1], [t3.pk2]), filter(nil), rowset=256
equal_conds([t3.b = t0.a]), other_conds(nil)
1 - output([t0.a]), filter(nil), rowset=256,
1 - output([t0.a]), filter(nil), rowset=256
access([t0.a]), partitions(p0)
2 - output([t3.pk1], [t3.pk2], [t3.b], [t3.a]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([t0.__pk_increment]), range(MIN ; MAX)always true
2 - output([t3.pk1], [t3.pk2], [t3.b], [t3.a]), filter(nil), rowset=256
access([t3.pk1], [t3.pk2], [t3.b], [t3.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t3.pk1], [t3.pk2]), range(MIN,MIN ; MAX,MAX)always true
select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5);
a b pk1 pk2
0 0 0 0
@ -134,23 +140,25 @@ a b pk1 pk2
9 9 9 9
explain select * from t1 where a in (select b from t2);
Query Plan
========================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------
|0 |HASH SEMI JOIN| |3 |6 |
|1 | TABLE SCAN |t1 |3 |2 |
|2 | TABLE SCAN |t2(b)|10 |3 |
========================================
Outputs & filters:
================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
------------------------------------------------
|0 |HASH SEMI JOIN | |3 |6 |
|1 | TABLE SCAN |t1 |3 |2 |
|2 | TABLE SCAN |t2(b)|10 |3 |
================================================
Outputs & filters:
-------------------------------------
0 - output([t1.a], [t1.b]), filter(nil), rowset=256,
0 - output([t1.a], [t1.b]), filter(nil), rowset=256
equal_conds([t1.a = t2.b]), other_conds(nil)
1 - output([t1.a], [t1.b]), filter(nil), rowset=256,
1 - output([t1.a], [t1.b]), filter(nil), rowset=256
access([t1.a], [t1.b]), partitions(p0)
2 - output([t2.b]), filter(nil), rowset=256,
is_index_back=false, is_global_index=false,
range_key([t1.__pk_increment]), range(MIN ; MAX)always true
2 - output([t2.b]), filter(nil), rowset=256
access([t2.b]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.b], [t2.__pk_increment]), range(MIN,MIN ; MAX,MAX)always true
select * from t1;
a b
1 1
@ -189,35 +197,38 @@ explain select 1 from t2 where
c2 in (select 1 from t3, t2) and
c1 in (select convert(c6,char(1)) from t2);
Query Plan
=====================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
-----------------------------------------------------
|0 |HASH SEMI JOIN | |1 |6 |
|1 | NESTED-LOOP JOIN CARTESIAN| |1 |4 |
|2 | TABLE SCAN |t2 |1 |2 |
|3 | MATERIAL | |1 |2 |
|4 | SUBPLAN SCAN |VIEW3|1 |2 |
|5 | TABLE SCAN |t3 |1 |2 |
|6 | TABLE SCAN |t2 |1 |2 |
=====================================================
Outputs & filters:
=============================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-------------------------------------------------------------
|0 |HASH SEMI JOIN | |1 |6 |
|1 | NESTED-LOOP JOIN CARTESIAN | |1 |4 |
|2 | TABLE SCAN |t2 |1 |2 |
|3 | MATERIAL | |1 |2 |
|4 | SUBPLAN SCAN |VIEW3|1 |2 |
|5 | TABLE SCAN |t3 |1 |2 |
|6 | TABLE SCAN |t2 |1 |2 |
=============================================================
Outputs & filters:
-------------------------------------
0 - output([1]), filter(nil), rowset=256,
0 - output([1]), filter(nil), rowset=256
equal_conds([cast(t2.c1, VARCHAR(1048576)) = cast(cast(t2.c6, CHAR(1)), VARCHAR(1048576))]), other_conds(nil)
1 - output([t2.c1]), filter(nil), rowset=256,
conds(nil), nl_params_(nil)
2 - output([t2.c1]), filter([cast(t2.c2, DECIMAL(-1, -1)) = cast(1, DECIMAL(1, 0))]), rowset=256,
1 - output([t2.c1]), filter(nil), rowset=256
conds(nil), nl_params_(nil), batch_join=false
2 - output([t2.c1]), filter([cast(t2.c2, DECIMAL(-1, -1)) = cast(1, DECIMAL(1, 0))]), rowset=256
access([t2.c2], [t2.c1]), partitions(p0)
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([t2.__pk_increment]), range(MIN ; MAX)always true
3 - output(nil), filter(nil), rowset=256
4 - output(nil), filter(nil), rowset=256,
4 - output(nil), filter(nil), rowset=256
access(nil)
5 - output([1]), filter(nil), rowset=256,
access(nil), partitions(p0),
limit(1), offset(nil)
6 - output([t2.c6]), filter(nil), rowset=256,
5 - output([1]), filter(nil), rowset=256
access(nil), partitions(p0)
limit(1), offset(nil), is_index_back=false, is_global_index=false,
range_key([t3.__pk_increment]), range(MIN ; MAX)always true
6 - output([t2.c6]), filter(nil), rowset=256
access([t2.c6]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([t2.__pk_increment]), range(MIN ; MAX)always true
drop table t2, t3;
#
# BUG#57431: subquery returns wrong result (semijoin=on) with pred AND

View File

@ -528,7 +528,7 @@ create view v1 as
with RECURSIVE qn (foo, bar) as (select 1,1 from dual) select * from qn;
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE VIEW `v1` AS WITH RECURSIVE`qn`(foo, bar) as (select 1 AS `foo`,1 AS `bar`) select `qn`.`foo` AS `foo`,`qn`.`bar` AS `bar` from `qn` utf8mb4 utf8mb4_general_ci
v1 CREATE VIEW `v1` AS WITH RECURSIVE `qn`(`foo`, `bar`) as (select 1 AS `foo`,1 AS `bar`) select `qn`.`foo` AS `foo`,`qn`.`bar` AS `bar` from `qn` utf8mb4 utf8mb4_general_ci
select * from v1;
+-----+-----+
@ -541,7 +541,7 @@ create view v1 as
with RECURSIVE qn (foo, bar) as (select 1,1 from t1) select * from qn;
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE VIEW `v1` AS WITH RECURSIVE`qn`(foo, bar) as (select 1 AS `foo`,1 AS `bar` from `cte_st`.`t1`) select `qn`.`foo` AS `foo`,`qn`.`bar` AS `bar` from `qn` utf8mb4 utf8mb4_general_ci
v1 CREATE VIEW `v1` AS WITH RECURSIVE `qn`(`foo`, `bar`) as (select 1 AS `foo`,1 AS `bar` from `cte_st`.`t1`) select `qn`.`foo` AS `foo`,`qn`.`bar` AS `bar` from `qn` utf8mb4 utf8mb4_general_ci
select * from v1;
+-----+-----+
| foo | bar |
@ -588,7 +588,7 @@ select (with RECURSIVE qn as (select 'with RECURSIVE' from dual) select * from q
from dual;
show create view v;
View Create View character_set_client collation_connection
v CREATE VIEW `v` AS select (WITH RECURSIVE`qn` as (select 'with RECURSIVE' AS `with RECURSIVE`) select `qn`.`with RECURSIVE` from `qn`) AS `scal_subq` utf8mb4 utf8mb4_general_ci
v CREATE VIEW `v` AS select (WITH RECURSIVE `qn` as (select 'with RECURSIVE' AS `with RECURSIVE`) select `qn`.`with RECURSIVE` from `qn`) AS `scal_subq` utf8mb4 utf8mb4_general_ci
select * from v;
+----------------+
| scal_subq |
@ -599,7 +599,7 @@ drop view v;
create view v as select * from (with RECURSIVE qn as (select 'with RECURSIVE' from dual) select * from qn) dt;
show create view v;
View Create View character_set_client collation_connection
v CREATE VIEW `v` AS select `dt`.`with RECURSIVE` AS `with RECURSIVE` from (WITH RECURSIVE`qn` as (select 'with RECURSIVE' AS `with RECURSIVE`) select `qn`.`with RECURSIVE` AS `with RECURSIVE` from `qn`) dt utf8mb4 utf8mb4_general_ci
v CREATE VIEW `v` AS select `dt`.`with RECURSIVE` AS `with RECURSIVE` from (WITH RECURSIVE `qn` as (select 'with RECURSIVE' AS `with RECURSIVE`) select `qn`.`with RECURSIVE` AS `with RECURSIVE` from `qn`) dt utf8mb4 utf8mb4_general_ci
select * from v;
+----------------+
| with RECURSIVE |

View File

@ -1815,46 +1815,56 @@ Query Plan
|20| EXPRESSION | |
|21| TABLE SCAN |cte1|
====================================
Outputs & filters:
Outputs & filters:
-------------------------------------
0 - output([cte1.a], [cte1.b]), filter(nil), rowset=256,
conds([cte1.a < cte3.c]), nl_params_(nil)
1 - output([cte3.c]), filter(nil), rowset=256,
0 - output([cte1.a], [cte1.b]), filter(nil), rowset=256
conds([cte1.a < cte3.c]), nl_params_(nil), batch_join=false
1 - output([cte3.c]), filter(nil), rowset=256
access([cte3.c])
2 - output([UNION([1])], [UNION([2])], [UNION([3])]), filter(nil), rowset=256
3 - output([UNION([1])], [UNION([2])], [UNION([3])]), filter(nil), rowset=256
4 - output([UNION([1])], [UNION([2])], [UNION([3])]), filter(nil), rowset=256
5 - output([1], [1], [1]), filter(nil)
values({1, 1, 1})
6 - output([cte1.a + 1], [cte1.b + 1], [cte1.c + 1]), filter([cte1.a < 10]), rowset=256,
access([cte1.a], [cte1.b], [cte1.c]), partitions is NULL,
7 - output([cte2.a + 1], [cte2.b + 1], [cte2.c + 1]), filter([cte2.a < 10]), rowset=256,
access([cte2.a], [cte2.b], [cte2.c]), partitions is NULL,
8 - output([cte3.a + 1], [cte3.b + 1], [cte3.c + 1]), filter(nil), rowset=256,
conds([cte3.a < cte2.b]), nl_params_(nil)
9 - output([cte3.a], [cte3.b], [cte3.c]), filter([cte3.a < 10]), rowset=256,
access([cte3.a], [cte3.b], [cte3.c]), partitions is NULL,
10 - output([cte2.b]), filter(nil), rowset=256
11 - output([cte2.b]), filter([cte2.a < 3]), rowset=256,
6 - output([cte1.a + 1], [cte1.b + 1], [cte1.c + 1]), filter([cte1.a < 10]), rowset=256
access([cte1.a], [cte1.b], [cte1.c])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key(nil), range(MIN ; MAX)
7 - output([cte2.a + 1], [cte2.b + 1], [cte2.c + 1]), filter([cte2.a < 10]), rowset=256
access([cte2.a], [cte2.b], [cte2.c])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key(nil), range(MIN ; MAX)
8 - output([cte3.a + 1], [cte3.b + 1], [cte3.c + 1]), filter(nil), rowset=256
conds([cte3.a < cte2.b]), nl_params_(nil), batch_join=false
9 - output([cte3.a], [cte3.b], [cte3.c]), filter([cte3.a < 10]), rowset=256
access([cte3.a], [cte3.b], [cte3.c])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key(nil), range(MIN ; MAX)
10 - output([cte2.b]), filter(nil), rowset=256
11 - output([cte2.b]), filter([cte2.a < 3]), rowset=256
access([cte2.a], [cte2.b])
12 - output([UNION([1])], [UNION([2])], [UNION([3])]), filter(nil), rowset=256
13 - output([UNION([1])], [UNION([2])], [UNION([3])]), filter(nil), rowset=256
14 - output([1], [1], [1]), filter(nil)
12 - output([UNION([1])], [UNION([2])], [UNION([3])]), filter(nil), rowset=256
13 - output([UNION([1])], [UNION([2])], [UNION([3])]), filter(nil), rowset=256
14 - output([1], [1], [1]), filter(nil)
values({1, 1, 1})
15 - output([cte1.a + 1], [cte1.b + 1], [cte1.c + 1]), filter([cte1.a < 10]), rowset=256,
access([cte1.a], [cte1.b], [cte1.c]), partitions is NULL,
16 - output([cte2.a + 1], [cte2.b + 1], [cte2.c + 1]), filter([cte2.a < 10]), rowset=256,
access([cte2.a], [cte2.b], [cte2.c]), partitions is NULL,
17 - output([cte1.a], [cte1.b]), filter(nil), rowset=256
18 - output([cte1.a], [cte1.b]), filter(nil), rowset=256,
15 - output([cte1.a + 1], [cte1.b + 1], [cte1.c + 1]), filter([cte1.a < 10]), rowset=256
access([cte1.a], [cte1.b], [cte1.c])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key(nil), range(MIN ; MAX)
16 - output([cte2.a + 1], [cte2.b + 1], [cte2.c + 1]), filter([cte2.a < 10]), rowset=256
access([cte2.a], [cte2.b], [cte2.c])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key(nil), range(MIN ; MAX)
17 - output([cte1.a], [cte1.b]), filter(nil), rowset=256
18 - output([cte1.a], [cte1.b]), filter(nil), rowset=256
access([cte1.a], [cte1.b])
19 - output([UNION([1])], [UNION([2])], [UNION([3])]), filter(nil), rowset=256
20 - output([1], [1], [1]), filter(nil)
19 - output([UNION([1])], [UNION([2])], [UNION([3])]), filter(nil), rowset=256
20 - output([1], [1], [1]), filter(nil)
values({1, 1, 1})
21 - output([cte1.a + 1], [cte1.b + 1], [cte1.c + 1]), filter([cte1.a < 10]), rowset=256,
access([cte1.a], [cte1.b], [cte1.c]), partitions is NULL,
21 - output([cte1.a + 1], [cte1.b + 1], [cte1.c + 1]), filter([cte1.a < 10]), rowset=256
access([cte1.a], [cte1.b], [cte1.c])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key(nil), range(MIN ; MAX)
set ob_query_timeout = 100000000;
with RECURSIVE cte1(a,b,c) as