mark some file to been opensource for ce-farm

This commit is contained in:
niyuhang
2023-11-15 11:44:43 +00:00
committed by ob-robot
parent 4900683cff
commit c8ace58297
685 changed files with 1080566 additions and 111051 deletions

View File

@ -0,0 +1,185 @@
drop table if exists t1,t2;
set ob_enable_index_direct_select=1;
alter system set merger_check_interval = '10s' tenant sys;
alter system set merger_check_interval = '10s' tenant all_user;
alter system set merger_check_interval = '10s' tenant all_meta;
create table t1(
a1 char(3) primary key,
a2 int,
a3 char(3),
a4 float,
a5 datetime
);
create table t2(
a1 char(3) primary key,
a2 char(17),
a3 char(2),
a4 char(3)
);
insert into t1 values('AME',0,'SEA',0.100,date'1942-02-19');
insert into t1 values('HBR',1,'SEA',0.085,date'1948-03-05');
insert into t1 values('BOT',2,'SEA',0.085,date'1951-11-29');
insert into t1 values('BMC',3,'SEA',0.085,date'1958-09-08');
insert into t1 values('TWU',0,'LAX',0.080,date'1969-10-05');
insert into t1 values('BDL',0,'DEN',0.080,date'1960-11-27');
insert into t1 values('DTX',1,'NYC',0.080,date'1961-05-04');
insert into t1 values('PLS',1,'WDC',0.075,date'1949-01-02');
insert into t1 values('ZAJ',2,'CHI',0.075,date'1960-06-15');
insert into t1 values('VVV',2,'MON',0.075,date'1959-06-28');
insert into t1 values('GTM',3,'DAL',0.070,date'1977-09-23');
insert into t1 values('SSJ',null,'CHI',null,date'1974-03-19');
insert into t1 values('KKK',3,'ATL',null,null);
insert into t1 values('XXX',null,'MIN',null,null);
insert into t1 values('WWW',1,'LED',null,null);
insert into t1 values('GG3',3,'DD3',0.051,now());
insert into t1 values('GG2',3,'DD2',0.052,now());
insert into t1 values('GG1',3,'DD1',0.053,now());
insert into t2 values('TKF','Seattle','WA','AME');
insert into t2 values('LCC','Los Angeles','CA','TWU');
insert into t2 values('DEN','Denver','CO','BDL');
insert into t2 values('SDC','San Diego','CA','TWU');
insert into t2 values('NOL','New Orleans','LA','GTM');
insert into t2 values('LAK','Los Angeles','CA','TWU');
insert into t2 values('AAA','AAA','AA','AME');
create index i2 on t1(a2);
create index i3 on t1(a3);
create index i5 on t1(a5);
select * from (select a1, a2*2+1 as b2 from t1 where a2>=1-1 and a2<=round(9.0/2.0)*2) as t;
a1 b2
AME 1
BDL 1
BMC 7
BOT 5
DTX 3
GG1 7
GG2 7
GG3 7
GTM 7
HBR 3
KKK 7
PLS 3
TWU 1
VVV 5
WWW 3
ZAJ 5
select * from (select a1, a2*2+1 as b2, a3 from t1 where a2>=1-1 and a2<=round(9.0/2.0)*2) as t;
a1 b2 a3
AME 1 SEA
BDL 1 DEN
BMC 7 SEA
BOT 5 SEA
DTX 3 NYC
GG1 7 DD1
GG2 7 DD2
GG3 7 DD3
GTM 7 DAL
HBR 3 SEA
KKK 7 ATL
PLS 3 WDC
TWU 1 LAX
VVV 5 MON
WWW 3 LED
ZAJ 5 CHI
select * from (select a1, a2*2+1 as b2 from t1 where a2>=1-(9-8)+(3*5)-45/3 and a2<=100%55-35) as t;
a1 b2
AME 1
BDL 1
BMC 7
BOT 5
DTX 3
GG1 7
GG2 7
GG3 7
GTM 7
HBR 3
KKK 7
PLS 3
TWU 1
VVV 5
WWW 3
ZAJ 5
select * from (select a1, a2*2+1 as b2, a3 from t1 where a2>=1-(9-8)+(3*5)-45/3 and a2<=100%55-35) as t;
a1 b2 a3
AME 1 SEA
BDL 1 DEN
BMC 7 SEA
BOT 5 SEA
DTX 3 NYC
GG1 7 DD1
GG2 7 DD2
GG3 7 DD3
GTM 7 DAL
HBR 3 SEA
KKK 7 ATL
PLS 3 WDC
TWU 1 LAX
VVV 5 MON
WWW 3 LED
ZAJ 5 CHI
select * from (select a1,a2*2+1 as b2,a3,a4,a5 from t1 where a3>=concat('D', 'EE') and a3<=concat('M', 'PP')) as t;
a1 b2 a3 a4 a5
BDL 1 DEN 0.08 timestamp
TWU 1 LAX 0.08 timestamp
VVV 5 MON 0.075 timestamp
WWW 3 LED NULL timestamp
XXX NULL MIN NULL timestamp
select * from (select a1,a2*2+1 as b2,a3,a4,a5 from t1 where a3>=concat(upper(substr('abcde',4,1)), upper(substr('ccddee',5,2))) and a3<=concat(upper(substr('lmnop',2,1)), upper(substr('ooppqq',3,2)))) as t;
a1 b2 a3 a4 a5
BDL 1 DEN 0.08 timestamp
TWU 1 LAX 0.08 timestamp
VVV 5 MON 0.075 timestamp
WWW 3 LED NULL timestamp
XXX NULL MIN NULL timestamp
select * from (select a1,a2*2+1 as b2,a3,a4,a5 from t1 where a4>=0.75/10+1-1 and a4<=0.2*0.4+4%2) as t;
a1 b2 a3 a4 a5
BDL 1 DEN 0.08 timestamp
DTX 3 NYC 0.08 timestamp
PLS 3 WDC 0.075 timestamp
TWU 1 LAX 0.08 timestamp
VVV 5 MON 0.075 timestamp
ZAJ 5 CHI 0.075 timestamp
select * from (select a1,a2*2+1 as b2,a3,a4 from t1 where a5>=date_add(now(), interval -60 minute) and a5<=date_add(current_timestamp(), interval -1 microsecond)) as t;
a1 b2 a3 a4
GG1 7 DD1 0.053
GG2 7 DD2 0.052
GG3 7 DD3 0.051
select * from (select a1,a2*2+1 as b2,a3,a4 from t1 where a5>=date_add(current_timestamp(), interval -60 minute) and a5<=date_add(current_timestamp(), interval -1 microsecond)) as t;
a1 b2 a3 a4
GG1 7 DD1 0.053
GG2 7 DD2 0.052
GG3 7 DD3 0.051
select * from (select a1,a2*2+1 as b2,a3,a4 from t1 where a5>=date_add(current_timestamp(), interval -60 minute) and a5<=date_add(now(), interval -1 microsecond)) as t;
a1 b2 a3 a4
GG1 7 DD1 0.053
GG2 7 DD2 0.052
GG3 7 DD3 0.051
select * from (select a1,a2*2+1 as b2,a3,a4 from t1 where a5>=date_sub(now(), interval 60 minute) and a5<=date_sub(current_timestamp(), interval 1 microsecond)) as t;
a1 b2 a3 a4
GG1 7 DD1 0.053
GG2 7 DD2 0.052
GG3 7 DD3 0.051
select * from (select a1,a2*2+1 as b2,a3,a4 from t1 where a5>=date_sub(current_timestamp(), interval 60 minute) and a5<=date_sub(current_timestamp(), interval 1 microsecond)) as t;
a1 b2 a3 a4
GG1 7 DD1 0.053
GG2 7 DD2 0.052
GG3 7 DD3 0.051
select * from (select a1,a2*2+1 as b2,a3,a4 from t1 where a5>=date_sub(current_timestamp(), interval 60 minute) and a5<=date_sub(now(), interval 1 microsecond)) as t;
a1 b2 a3 a4
GG1 7 DD1 0.053
GG2 7 DD2 0.052
GG3 7 DD3 0.051
select * from (select a1,a2*2+1 as b2,a3,a4 from t1 where a5>=date_add(now(), interval -60 minute) and a5<=date_sub(current_timestamp(), interval 1 microsecond)) as t;
a1 b2 a3 a4
GG1 7 DD1 0.053
GG2 7 DD2 0.052
GG3 7 DD3 0.051
select * from (select a1,a2*2+1 as b2,a3,a4 from t1 where a5>=date_add(current_timestamp(), interval -60 minute) and a5<=date_sub(current_timestamp(), interval 1 microsecond)) as t;
a1 b2 a3 a4
GG1 7 DD1 0.053
GG2 7 DD2 0.052
GG3 7 DD3 0.051
select * from (select a1,a2*2+1 as b2,a3,a4 from t1 where a5>=date_add(current_timestamp(), interval -60 minute) and a5<=date_sub(now(), interval 1 microsecond)) as t;
a1 b2 a3 a4
GG1 7 DD1 0.053
GG2 7 DD2 0.052
GG3 7 DD3 0.051

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,64 @@
drop table if exists GG;
drop table if exists F;
drop table if exists Q;
CREATE TABLE `GG` (
`col_varchar_20` varchar(20) DEFAULT NULL,
`col_varchar_10_key` varchar(10) DEFAULT NULL,
`col_date` date DEFAULT NULL,
`pk` int(11) NOT NULL,
`col_datetime` datetime DEFAULT NULL,
`col_int` int(11) DEFAULT NULL,
`col_varchar_20_key` varchar(20) DEFAULT NULL,
`col_datetime_key` datetime DEFAULT NULL,
`col_date_key` date DEFAULT NULL,
`col_int_key` int(11) DEFAULT NULL,
`col_varchar_10` varchar(10) DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `idx3` (`col_varchar_10_key`) BLOCK_SIZE 16384,
KEY `idx5` (`col_varchar_20_key`) BLOCK_SIZE 16384,
KEY `idx9` (`col_datetime_key`) BLOCK_SIZE 16384,
KEY `idx7` (`col_date_key`) BLOCK_SIZE 16384,
KEY `idx1` (`col_int_key`) BLOCK_SIZE 16384
) DEFAULT CHARSET = utf8mb4 BLOCK_SIZE = 16384 USE_BLOOM_FILTER = FALSE;
CREATE TABLE `F` (
`col_date` date DEFAULT NULL,
`col_datetime` datetime DEFAULT NULL,
`col_date_key` date DEFAULT NULL,
`pk` int(11) NOT NULL,
`col_int` int(11) DEFAULT NULL,
`col_varchar_10_key` varchar(10) DEFAULT NULL,
`col_varchar_20` varchar(20) DEFAULT NULL,
`col_int_key` int(11) DEFAULT NULL,
`col_varchar_20_key` varchar(20) DEFAULT NULL,
`col_varchar_10` varchar(10) DEFAULT NULL,
`col_datetime_key` datetime DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `idx7` (`col_date_key`) BLOCK_SIZE 16384,
KEY `idx3` (`col_varchar_10_key`) BLOCK_SIZE 16384,
KEY `idx1` (`col_int_key`) BLOCK_SIZE 16384,
KEY `idx5` (`col_varchar_20_key`) BLOCK_SIZE 16384,
KEY `idx9` (`col_datetime_key`) BLOCK_SIZE 16384
) DEFAULT CHARSET = utf8mb4 BLOCK_SIZE = 16384
USE_BLOOM_FILTER = FALSE;
CREATE TABLE `Q` (
`col_int_key` int(11) DEFAULT NULL,
`col_varchar_20` varchar(20) DEFAULT NULL,
`pk` int(11) NOT NULL,
`col_varchar_20_key` varchar(20) DEFAULT NULL,
`col_date_key` date DEFAULT NULL,
`col_date` date DEFAULT NULL,
`col_varchar_10_key` varchar(10) DEFAULT NULL,
`col_varchar_10` varchar(10) DEFAULT NULL,
`col_datetime_key` datetime DEFAULT NULL,
`col_int` int(11) DEFAULT NULL,
`col_datetime` datetime DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `idx1` (`col_int_key`) BLOCK_SIZE 16384,
KEY `idx5` (`col_varchar_20_key`) BLOCK_SIZE 16384,
KEY `idx7` (`col_date_key`) BLOCK_SIZE 16384,
KEY `idx3` (`col_varchar_10_key`) BLOCK_SIZE 16384,
KEY `idx9` (`col_datetime_key`) BLOCK_SIZE 16384
) DEFAULT CHARSET = utf8mb4 BLOCK_SIZE = 16384
USE_BLOOM_FILTER = FALSE;
SELECT GRANDPARENT1 . pk AS G1 FROM GG AS GRANDPARENT1 WHERE GRANDPARENT1 . `col_varchar_10` IN ( SELECT PARENT1 . `col_varchar_10_key` AS P1 FROM F AS PARENT1 LEFT JOIN Q AS PARENT2 USING ( pk ) WHERE ( ( PARENT1 . `pk` > GRANDPARENT1 . `col_int` ) OR GRANDPARENT1 . `col_varchar_10` >= 'i' ) ) AND ( ( ( ( ( ( ( GRANDPARENT1 . `col_varchar_20` < 'x' OR GRANDPARENT1 . `col_datetime` BETWEEN '2002-05-19' AND '2000-10-13' ) OR GRANDPARENT1 . pk IS NULL ) OR GRANDPARENT1 . `col_varchar_20` >= 'd' ) OR GRANDPARENT1 . `pk` <> 8 ) AND GRANDPARENT1 . `pk` >= 5 ) AND GRANDPARENT1 . `col_date` >= '2004-07-28' ) OR NOT GRANDPARENT1 . pk IS UNKNOWN ) GROUP BY GRANDPARENT1 . pk ORDER BY GRANDPARENT1 . pk LIMIT 9;
G1

View File

@ -0,0 +1,68 @@
DROP TABLE IF EXISTS B;
CREATE TABLE B (
col_varchar_10_key varchar(10),
pk int,
col_datetime_key datetime,
col_date_key date,
col_varchar_20_key varchar(20),
col_date date,
col_varchar_10 varchar(10),
col_varchar_20 varchar(20),
col_int_key int,
col_datetime datetime,
col_int int,
/*Indices*/
key idx3(col_varchar_10_key ),
primary key (pk),
key idx9(col_datetime_key ),
key idx7(col_date_key ),
key idx5(col_varchar_20_key ),
key idx1(col_int_key )) ;
INSERT INTO B VALUES ('kkp', 1, '2004-10-16 00:57:16', '2004-01-14 09:42:56', 'REEQA', '2000-05-07 20:53:16', 't', 'RJWCV', NULL, '2004-08-27 11:24:22', NULL) ;
COMMIT;
DROP TABLE IF EXISTS C;
CREATE TABLE C (
col_varchar_10_key varchar(10),
col_date_key date,
col_varchar_20 varchar(20),
col_datetime datetime,
pk int,
col_datetime_key datetime,
col_int_key int,
col_varchar_10 varchar(10),
col_int int,
col_date date,
col_varchar_20_key varchar(20),
/*Indices*/
key idx3(col_varchar_10_key ),
key idx7(col_date_key ),
primary key (pk),
key idx9(col_datetime_key ),
key idx1(col_int_key ),
key idx5(col_varchar_20_key )) ;
INSERT INTO C VALUES ('m', '2009-05-26 08:23:35', 'ekkpo', '2008-03-08 07:14:41', 1, '2009-08-02 20:27:19', NULL, 'm', NULL, '2000-09-07 13:19:46', 'x') , ('WQNOL', '2000-07-21 17:07:25', 'NVCLE', '2006-07-26 20:52:57', 2, '2001-01-13 04:08:55', 1, 'that', NULL, '2002-07-10 00:05:57', 'r') ;
COMMIT;
DROP TABLE IF EXISTS BB;
CREATE TABLE BB (
pk int,
col_date date,
col_int int,
col_datetime datetime,
col_int_key int,
col_varchar_10 varchar(10),
col_varchar_20_key varchar(20),
col_varchar_10_key varchar(10),
col_datetime_key datetime,
col_date_key date,
col_varchar_20 varchar(20),
/*Indices*/
primary key (pk),
key idx1(col_int_key ),
key idx5(col_varchar_20_key ),
key idx3(col_varchar_10_key ),
key idx9(col_datetime_key ),
key idx7(col_date_key )) ;
INSERT INTO BB VALUES (1, '2003-04-23 18:41:16', 6, '2005-10-24 18:18:51', NULL, 'cwakbywrvs', 'u', 'don\'t', '2004-11-12 13:38:24', '2006-07-05 09:53:27', 'dcwakbyw') , (2, '2003-03-22 22:28:58', 2078998528, '2005-09-18 22:12:43', 1550974976, 'udc', 'WBKOU', 'HZHFS', '2000-04-25 09:07:11', '2001-09-13 00:42:07', 'IORCN') , (3, '2001-09-14 17:35:49', 4, '2005-03-07 05:20:49', 1091305472, 'NFLSW', 'her', 'out', '2005-02-02 14:47:19', '2007-01-20 03:29:40', 'tudc') , (4, '2006-01-01 23:25:41', NULL, '2000-11-12 21:13:27', 1665990656, 'LYLSS', 'otu', 'fotudcw', '2004-09-03 11:49:01', '2009-01-27 09:15:41', 'n') , (5, '2004-02-02 20:08:21', 2061369344, '2004-08-15 04:50:15', 1711734784, 'hfotudc', 'you\'re', 'khfot', '2004-08-03 23:41:18', '2000-01-22 17:43:03', 'vkhfotu') , (6, '2008-09-10 14:06:23', NULL, '2009-09-14 09:57:06', NULL, 'kvkhfot', 'bkvkhfo', 'x', '2004-01-21 19:21:48', '2007-10-20 07:39:44', 'FHWWV') , (7, '2003-07-04 00:34:31', NULL, '2008-07-27 01:31:54', -106692608, 'how', 'pbkvkh', 'i', '2000-05-07 05:59:07', '2000-11-27 00:01:21', 'DYXZD') , (8, '2007-03-15 19:03:40', NULL, '2002-12-08 17:54:25', 2, 'YXRPH', 'or', 'r', '2002-07-21 02:23:52', '2007-08-16 01:57:46', 'is') , (9, '2002-07-15 23:38:00', NULL, '2004-07-17 00:37:31', NULL, 'q', 'GFJQM', 'UZSQL', '2009-04-17 16:08:23', '2002-11-13 10:10:01', 'YGWXF') , (10, '2008-06-16 09:37:06', NULL, '2005-05-01 10:31:43', NULL, 'i', 'RUTYP', 'going', '2005-10-28 05:29:47', '2000-10-18 18:00:15', 'wpbkvkhf') , (11, '2009-01-27 05:17:20', -1565130752, '2006-01-07 01:49:08', NULL, 'FVHBX', 'k', 'back', '2007-06-04 02:44:36', '2006-04-17 11:51:02', 'my') , (12, '2008-09-24 18:38:14', -2060648448, '2009-11-13 13:17:05', NULL, 'x', 'ewp', 'a', '2007-11-03 14:29:08', '2007-05-01 14:13:50', 'e') , (13, '2008-01-24 14:22:57', NULL, '2002-11-26 19:45:28', 7, 'r', 'vewpbkvkh', 'l', '2009-07-10 13:35:54', '2008-01-25 01:56:47', 'he') , (14, '2008-04-25 00:17:00', NULL, '2006-03-07 23:02:00', NULL, 'cvewpb', 'or', 'ecvewpb', '2005-11-04 03:58:04', '2005-10-11 20:09:24', 'x') , (15, '2004-10-07 20:19:35', 1, '2008-01-04 05:10:39', 726663168, 'from', 'm', 'g', '2001-12-17 22:26:20', '2008-05-19 07:39:44', 'ZWYWB') , (16, '2001-09-06 07:16:23', 3, '2009-06-19 15:09:57', 2, 'o', 'here', 'o', '2006-07-01 11:55:01', '2006-01-27 17:54:25', 'GBCEX') , (17, '2008-03-06 09:09:32', 3, '2001-06-04 04:13:34', NULL, 'PUMFK', 'p', 'a', '2009-04-26 05:19:51', '2007-02-23 03:34:16', 'x') , (18, '2006-12-21 18:11:00', -404226048, '2004-06-11 08:48:52', 1, 'a', 'fecv', 'will', '2008-08-23 20:26:27', '2002-06-24 09:11:02', 'w') , (19, '2002-10-08 05:53:04', 2120482816, '2000-12-17 19:34:45', NULL, 'rwfecvew', 'ASJFE', 'zrw', '2004-07-25 04:19:45', '2006-09-20 19:38:40', 'QJNIQ') , (20, '2006-09-13 10:03:21', -1152385024, '2002-05-03 02:10:39', -15466496, 'k', 'fkzrwfec', 'u', '2004-06-04 00:06:00', '2007-04-08 02:38:52', 'VTLYL') , (21, '2000-03-08 22:50:32', -616038400, '2009-04-10 10:17:42', -1163395072, 'YKTPU', 'YDZSJ', 'with', '2006-08-25 05:45:16', '2005-07-18 21:14:55', 'sfkzrwf') , (22, '2002-05-27 21:53:54', 1513816064, '2002-08-09 18:52:10', 1348403200, 'h', 'going', 'VALIW', '2008-07-14 13:29:27', '2008-01-11 05:06:30', 'MZOIR') , (23, '2002-10-20 19:07:26', 5, '2004-01-25 07:30:01', NULL, 'UDIUZ', 'right', 'o', '2007-10-26 01:17:12', '2009-11-15 09:18:18', 'BERZH') , (24, '2001-07-01 02:58:05', NULL, '2001-03-05 15:25:43', 1, 'd', 'did', 'tsf', '2009-10-03 18:08:36', '2003-03-13 14:00:41', 'atsfkzr') , (25, '2003-05-10 04:15:51', 286654464, '2004-07-13 12:36:34', -1463091200, 'WNBRB', 'AYTIL', 'r', '2003-11-03 16:33:16', '2005-10-26 18:35:00', 'p') , (26, '2008-03-21 04:56:31', NULL, '2000-10-17 04:18:14', 233897984, 'hats', 'ahatsfkz', 'time', '2009-10-01 10:33:01', '2004-09-10 07:43:53', 'p') , (27, '2008-12-12 05:01:00', NULL, '2004-01-02 23:20:33', 7, 'NQKCO', 'TVTTB', 'KJYNW', '2000-05-06 14:41:27', '2003-11-28 23:04:01', 'yahatsfkz') , (28, '2005-09-08 16:11:04', NULL, '2002-03-05 17:07:00', NULL, 'i', 'e', 'fyahat', '2008-03-18 11:56:51', '2004-04-21 21:18:29', 'i') ;
COMMIT;
SELECT DISTINCT OUTR . `col_varchar_20` AS X FROM C AS OUTR2 LEFT JOIN B AS OUTR ON ( OUTR2 . `col_varchar_20` <> OUTR . `col_varchar_20` ) WHERE OUTR . `col_varchar_10` IN ( SELECT DISTINCT INNR . `col_varchar_20` AS Y FROM BB AS INNR2 LEFT JOIN BB AS INNR ON ( INNR2 . `col_date_key` = INNR . `col_date_key` ) WHERE INNR . `col_date_key` = INNR . `col_datetime_key` AND OUTR . `pk` IS NOT NULL ORDER BY INNR . `col_int` ) OR ( OUTR . `pk` > 8 AND NOT OUTR . `col_int_key` < 0 ) HAVING X >= '2002-01-19 16:26:37' ORDER BY OUTR . `col_int_key` , OUTR . `pk`;
X

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,347 @@
drop database if exists hualong;
create database hualong;
use hualong;
CREATE TABLE `cb_dep_acct_54` ( `acctnbr` bigint(20) NOT NULL, `curracctstatcd` varchar(4) NOT NULL, PRIMARY KEY (`acctnbr`)) partition by hash(acctnbr) partitions 5;
CREATE TABLE `cb_dep_acctbal_54` ( `acctnbr` bigint(20) NOT NULL, `balcatcd` varchar(4) NOT NULL, `baltypcd` varchar(4) NOT NULL, PRIMARY KEY (`acctnbr`, `balcatcd`, `baltypcd`));
CREATE TABLE `cb_dep_rxtnbal_54` ( `acctnbr` varchar(34) NOT NULL, `rtxnnbr` bigint(20) NOT NULL, `balcatcd` varchar(4) NOT NULL, `baltypcd` varchar(4) NOT NULL);
insert into cb_dep_acct_54 values (1, 'CLS');
insert into cb_dep_acct_54 values (2, 'CLS');
insert into cb_dep_acct_54 values (3, 'CCC');
insert into cb_dep_acctbal_54 values (1, 3, 4);
insert into cb_dep_acctbal_54 values (3, 7, 9);
insert into cb_dep_acctbal_54 values (5, 6, 2333);
insert into cb_dep_rxtnbal_54 values (1, 4, 3, 2);
explain select * from cb_dep_acctbal_54 s, cb_dep_acct_54 a where s.acctnbr = a.acctnbr and (a.curracctstatcd != 'CLS' or (a.curracctstatcd = 'CLS' and exists(select 1 from cb_dep_rxtnbal_54 r where r.acctnbr = a.acctnbr)));
Query Plan
=======================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------------------
|0 |MERGE JOIN | |2 |30 |
|1 |├─TABLE FULL SCAN |s |3 |3 |
|2 |└─SORT | |2 |27 |
|3 | └─SUBPLAN SCAN |VIEW1 |2 |27 |
|4 | └─UNION ALL | |2 |27 |
|5 | ├─PX COORDINATOR | |1 |12 |
|6 | │ └─EXCHANGE OUT DISTR |:EX10000|1 |12 |
|7 | │ └─PX PARTITION ITERATOR | |1 |11 |
|8 | │ └─TABLE FULL SCAN |a |1 |11 |
|9 | └─HASH RIGHT SEMI JOIN | |1 |16 |
|10| ├─TABLE FULL SCAN |r |1 |3 |
|11| └─PX COORDINATOR | |2 |13 |
|12| └─EXCHANGE OUT DISTR |:EX20000|2 |12 |
|13| └─PX PARTITION ITERATOR| |2 |11 |
|14| └─TABLE FULL SCAN |a |2 |11 |
=======================================================================
Outputs & filters:
-------------------------------------
0 - output([s.acctnbr], [s.balcatcd], [s.baltypcd], [VIEW1.a.acctnbr], [VIEW1.a.curracctstatcd]), filter(nil), rowset=16
equal_conds([s.acctnbr = VIEW1.a.acctnbr]), other_conds(nil)
merge_directions([ASC])
1 - output([s.acctnbr], [s.balcatcd], [s.baltypcd]), filter(nil), rowset=16
access([s.acctnbr], [s.balcatcd], [s.baltypcd]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([s.acctnbr], [s.balcatcd], [s.baltypcd]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
2 - output([VIEW1.a.acctnbr], [VIEW1.a.curracctstatcd]), filter(nil), rowset=16
sort_keys([VIEW1.a.acctnbr, ASC])
3 - output([VIEW1.a.acctnbr], [VIEW1.a.curracctstatcd]), filter(nil), rowset=16
access([VIEW1.a.acctnbr], [VIEW1.a.curracctstatcd])
4 - output([UNION([1])], [UNION([2])]), filter(nil), rowset=16
5 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
6 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
dop=1
7 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
force partition granule
8 - output([a.acctnbr], [a.curracctstatcd]), filter([a.curracctstatcd != 'CLS']), rowset=16
access([a.acctnbr], [a.curracctstatcd]), partitions(p[0-4])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.acctnbr]), range(MIN ; MAX)always true
9 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
equal_conds([cast(r.acctnbr, DECIMAL(-1, -1)) = cast(a.acctnbr, DECIMAL(20, 0))]), other_conds(nil)
10 - output([r.acctnbr]), filter(nil), rowset=16
access([r.acctnbr]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([r.__pk_increment]), range(MIN ; MAX)always true
11 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
12 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
dop=1
13 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
force partition granule
14 - output([a.acctnbr], [a.curracctstatcd]), filter([a.curracctstatcd = 'CLS']), rowset=16
access([a.acctnbr], [a.curracctstatcd]), partitions(p[0-4])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.acctnbr]), range(MIN ; MAX)always true
explain select * from cb_dep_acctbal_54 s, cb_dep_acct_54 a where s.acctnbr = a.acctnbr and (a.curracctstatcd != 'CLS' or (a.curracctstatcd = 'CLS' and exists(select 1 from cb_dep_rxtnbal_54 r where r.acctnbr = a.acctnbr) and exists(select 1 from cb_dep_rxtnbal_54 r where r.acctnbr != a.acctnbr)));
Query Plan
===========================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
---------------------------------------------------------------------------
|0 |MERGE JOIN | |2 |30 |
|1 |├─TABLE FULL SCAN |s |3 |3 |
|2 |└─SORT | |2 |27 |
|3 | └─SUBPLAN SCAN |VIEW1 |2 |27 |
|4 | └─UNION ALL | |2 |27 |
|5 | ├─PX COORDINATOR | |1 |12 |
|6 | │ └─EXCHANGE OUT DISTR |:EX10000|1 |12 |
|7 | │ └─PX PARTITION ITERATOR | |1 |11 |
|8 | │ └─TABLE FULL SCAN |a |1 |11 |
|9 | └─MERGE SEMI JOIN | |1 |15 |
|10| ├─SORT | |1 |13 |
|11| │ └─NESTED-LOOP SEMI JOIN | |1 |13 |
|12| │ ├─PX COORDINATOR | |2 |13 |
|13| │ │ └─EXCHANGE OUT DISTR |:EX20000|2 |12 |
|14| │ │ └─PX PARTITION ITERATOR| |2 |11 |
|15| │ │ └─TABLE FULL SCAN |a |2 |11 |
|16| │ └─MATERIAL | |1 |3 |
|17| │ └─TABLE FULL SCAN |r |1 |3 |
|18| └─SORT | |1 |3 |
|19| └─TABLE FULL SCAN |r |1 |3 |
===========================================================================
Outputs & filters:
-------------------------------------
0 - output([s.acctnbr], [s.balcatcd], [s.baltypcd], [VIEW1.a.acctnbr], [VIEW1.a.curracctstatcd]), filter(nil), rowset=16
equal_conds([s.acctnbr = VIEW1.a.acctnbr]), other_conds(nil)
merge_directions([ASC])
1 - output([s.acctnbr], [s.balcatcd], [s.baltypcd]), filter(nil), rowset=16
access([s.acctnbr], [s.balcatcd], [s.baltypcd]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([s.acctnbr], [s.balcatcd], [s.baltypcd]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
2 - output([VIEW1.a.acctnbr], [VIEW1.a.curracctstatcd]), filter(nil), rowset=16
sort_keys([VIEW1.a.acctnbr, ASC])
3 - output([VIEW1.a.acctnbr], [VIEW1.a.curracctstatcd]), filter(nil), rowset=16
access([VIEW1.a.acctnbr], [VIEW1.a.curracctstatcd])
4 - output([UNION([1])], [UNION([2])]), filter(nil), rowset=16
5 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
6 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
dop=1
7 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
force partition granule
8 - output([a.acctnbr], [a.curracctstatcd]), filter([a.curracctstatcd != 'CLS']), rowset=16
access([a.acctnbr], [a.curracctstatcd]), partitions(p[0-4])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.acctnbr]), range(MIN ; MAX)always true
9 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
equal_conds([cast(r.acctnbr, DECIMAL(-1, -1)) = cast(a.acctnbr, DECIMAL(20, 0))]), other_conds(nil)
merge_directions([ASC])
10 - output([a.acctnbr], [a.curracctstatcd], [cast(a.acctnbr, DECIMAL(20, 0))]), filter(nil), rowset=16
sort_keys([cast(a.acctnbr, DECIMAL(20, 0)), ASC]), local merge sort
11 - output([a.acctnbr], [a.curracctstatcd], [cast(a.acctnbr, DECIMAL(20, 0))]), filter(nil), rowset=16
conds([cast(r.acctnbr, DECIMAL(-1, -1)) != cast(a.acctnbr, DECIMAL(20, 0))]), nl_params_(nil), use_batch=false
12 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
13 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
dop=1
14 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
force partition granule
15 - output([a.acctnbr], [a.curracctstatcd]), filter([a.curracctstatcd = 'CLS']), rowset=16
access([a.acctnbr], [a.curracctstatcd]), partitions(p[0-4])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.acctnbr]), range(MIN ; MAX)always true
16 - output([r.acctnbr]), filter(nil), rowset=16
17 - output([r.acctnbr]), filter(nil), rowset=16
access([r.acctnbr]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([r.__pk_increment]), range(MIN ; MAX)always true
18 - output([cast(r.acctnbr, DECIMAL(-1, -1))]), filter(nil), rowset=16
sort_keys([cast(r.acctnbr, DECIMAL(-1, -1)), ASC])
19 - output([cast(r.acctnbr, DECIMAL(-1, -1))]), filter(nil), rowset=16
access([r.acctnbr]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([r.__pk_increment]), range(MIN ; MAX)always true
explain select * from cb_dep_acctbal_54 s, cb_dep_acct_54 a where s.acctnbr = a.acctnbr and ((a.curracctstatcd != 'CLS' and exists(select 1 from cb_dep_acctbal_54 r where r.acctnbr = s.acctnbr)) or (a.curracctstatcd = 'CLS' and exists(select 1 from cb_dep_rxtnbal_54 r where r.acctnbr = a.acctnbr)));
Query Plan
=============================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-----------------------------------------------------------------------------
|0 |PX COORDINATOR | |2 |43 |
|1 |└─EXCHANGE OUT DISTR |:EX10003|2 |41 |
|2 | └─HASH UNION DISTINCT | |2 |38 |
|3 | ├─HASH JOIN | |1 |18 |
|4 | │ ├─PX PARTITION ITERATOR | |1 |11 |
|5 | │ │ └─TABLE FULL SCAN |a |1 |11 |
|6 | │ └─EXCHANGE IN DISTR | |3 |7 |
|7 | │ └─EXCHANGE OUT DISTR (PKEY) |:EX10000|3 |6 |
|8 | │ └─TABLE FULL SCAN |s |3 |3 |
|9 | └─EXCHANGE IN DISTR | |1 |20 |
|10| └─EXCHANGE OUT DISTR (PKEY) |:EX10002|1 |19 |
|11| └─MERGE JOIN | |1 |18 |
|12| ├─SORT | |1 |16 |
|13| │ └─HASH RIGHT SEMI JOIN | |1 |16 |
|14| │ ├─TABLE FULL SCAN |r |1 |3 |
|15| │ └─EXCHANGE IN DISTR | |2 |13 |
|16| │ └─EXCHANGE OUT DISTR |:EX10001|2 |12 |
|17| │ └─PX PARTITION ITERATOR| |2 |11 |
|18| │ └─TABLE FULL SCAN |a |2 |11 |
|19| └─TABLE FULL SCAN |s |3 |3 |
=============================================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(UNION([1]), UNION([2]), UNION([3]), UNION([4]), UNION([5]))]), filter(nil), rowset=16
1 - output([INTERNAL_FUNCTION(UNION([1]), UNION([2]), UNION([3]), UNION([4]), UNION([5]))]), filter(nil), rowset=16
dop=1
2 - output([UNION([1])], [UNION([2])], [UNION([3])], [UNION([4])], [UNION([5])]), filter(nil), rowset=16
3 - output([s.acctnbr], [s.balcatcd], [s.baltypcd], [a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
equal_conds([s.acctnbr = a.acctnbr]), other_conds(nil)
4 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
affinitize, force partition granule
5 - output([a.acctnbr], [a.curracctstatcd]), filter([a.curracctstatcd != 'CLS']), rowset=16
access([a.acctnbr], [a.curracctstatcd]), partitions(p[0-4])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.acctnbr]), range(MIN ; MAX)always true
6 - output([s.acctnbr], [s.balcatcd], [s.baltypcd]), filter(nil), rowset=16
7 - output([s.acctnbr], [s.balcatcd], [s.baltypcd]), filter(nil), rowset=16
(#keys=1, [s.acctnbr]), is_single, dop=1
8 - output([s.acctnbr], [s.balcatcd], [s.baltypcd]), filter(nil), rowset=16
access([s.acctnbr], [s.balcatcd], [s.baltypcd]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([s.acctnbr], [s.balcatcd], [s.baltypcd]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
9 - output([s.acctnbr], [s.balcatcd], [s.baltypcd], [a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
10 - output([s.acctnbr], [s.balcatcd], [s.baltypcd], [a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
(#keys=1, [s.acctnbr]), is_single, dop=1
11 - output([s.acctnbr], [s.balcatcd], [s.baltypcd], [a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
equal_conds([s.acctnbr = a.acctnbr]), other_conds(nil)
merge_directions([ASC])
12 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
sort_keys([a.acctnbr, ASC])
13 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
equal_conds([cast(r.acctnbr, DECIMAL(-1, -1)) = cast(a.acctnbr, DECIMAL(20, 0))]), other_conds(nil)
14 - output([r.acctnbr]), filter(nil), rowset=16
access([r.acctnbr]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([r.__pk_increment]), range(MIN ; MAX)always true
15 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
16 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
dop=1
17 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
force partition granule
18 - output([a.acctnbr], [a.curracctstatcd]), filter([a.curracctstatcd = 'CLS']), rowset=16
access([a.acctnbr], [a.curracctstatcd]), partitions(p[0-4])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.acctnbr]), range(MIN ; MAX)always true
19 - output([s.acctnbr], [s.balcatcd], [s.baltypcd]), filter(nil), rowset=16
access([s.acctnbr], [s.balcatcd], [s.baltypcd]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([s.acctnbr], [s.balcatcd], [s.baltypcd]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
explain select * from cb_dep_acctbal_54 s, cb_dep_acct_54 a where s.acctnbr = a.acctnbr and (a.curracctstatcd != 'CLS' or (a.curracctstatcd = 'CLS' and exists(select 1 from cb_dep_rxtnbal_54 r where r.acctnbr = a.acctnbr))) group by s.acctnbr;
Query Plan
=========================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-------------------------------------------------------------------------
|0 |MERGE GROUP BY | |2 |30 |
|1 |└─MERGE JOIN | |2 |30 |
|2 | ├─SORT | |2 |27 |
|3 | │ └─SUBPLAN SCAN |VIEW2 |2 |27 |
|4 | │ └─UNION ALL | |2 |27 |
|5 | │ ├─PX COORDINATOR | |1 |12 |
|6 | │ │ └─EXCHANGE OUT DISTR |:EX10000|1 |12 |
|7 | │ │ └─PX PARTITION ITERATOR | |1 |11 |
|8 | │ │ └─TABLE FULL SCAN |a |1 |11 |
|9 | │ └─HASH RIGHT SEMI JOIN | |1 |16 |
|10| │ ├─TABLE FULL SCAN |r |1 |3 |
|11| │ └─PX COORDINATOR | |2 |13 |
|12| │ └─EXCHANGE OUT DISTR |:EX20000|2 |12 |
|13| │ └─PX PARTITION ITERATOR| |2 |11 |
|14| │ └─TABLE FULL SCAN |a |2 |11 |
|15| └─TABLE FULL SCAN |s |3 |3 |
=========================================================================
Outputs & filters:
-------------------------------------
0 - output([s.acctnbr], [s.balcatcd], [s.baltypcd], [VIEW2.a.acctnbr], [VIEW2.a.curracctstatcd]), filter(nil), rowset=16
group([s.acctnbr]), agg_func(nil)
1 - output([s.acctnbr], [s.balcatcd], [s.baltypcd], [VIEW2.a.acctnbr], [VIEW2.a.curracctstatcd]), filter(nil), rowset=16
equal_conds([s.acctnbr = VIEW2.a.acctnbr]), other_conds(nil)
merge_directions([ASC])
2 - output([VIEW2.a.acctnbr], [VIEW2.a.curracctstatcd]), filter(nil), rowset=16
sort_keys([VIEW2.a.acctnbr, ASC])
3 - output([VIEW2.a.acctnbr], [VIEW2.a.curracctstatcd]), filter(nil), rowset=16
access([VIEW2.a.acctnbr], [VIEW2.a.curracctstatcd])
4 - output([UNION([1])], [UNION([2])]), filter(nil), rowset=16
5 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
6 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
dop=1
7 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
force partition granule
8 - output([a.acctnbr], [a.curracctstatcd]), filter([a.curracctstatcd != 'CLS']), rowset=16
access([a.acctnbr], [a.curracctstatcd]), partitions(p[0-4])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.acctnbr]), range(MIN ; MAX)always true
9 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
equal_conds([cast(r.acctnbr, DECIMAL(-1, -1)) = cast(a.acctnbr, DECIMAL(20, 0))]), other_conds(nil)
10 - output([r.acctnbr]), filter(nil), rowset=16
access([r.acctnbr]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([r.__pk_increment]), range(MIN ; MAX)always true
11 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
12 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
dop=1
13 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
force partition granule
14 - output([a.acctnbr], [a.curracctstatcd]), filter([a.curracctstatcd = 'CLS']), rowset=16
access([a.acctnbr], [a.curracctstatcd]), partitions(p[0-4])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.acctnbr]), range(MIN ; MAX)always true
15 - output([s.acctnbr], [s.balcatcd], [s.baltypcd]), filter(nil), rowset=16
access([s.acctnbr], [s.balcatcd], [s.baltypcd]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([s.acctnbr], [s.balcatcd], [s.baltypcd]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
explain select /*+ no_use_hash_aggregation */ * from cb_dep_acctbal_54 s, cb_dep_acct_54 a where s.acctnbr = a.acctnbr and (a.curracctstatcd != 'CLS' or (a.curracctstatcd = 'CLS' and exists(select 1 from cb_dep_rxtnbal_54 r where r.acctnbr = a.acctnbr))) group by a.acctnbr;
Query Plan
=========================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
-------------------------------------------------------------------------
|0 |MERGE GROUP BY | |2 |30 |
|1 |└─MERGE JOIN | |2 |30 |
|2 | ├─SORT | |2 |27 |
|3 | │ └─SUBPLAN SCAN |VIEW2 |2 |27 |
|4 | │ └─UNION ALL | |2 |27 |
|5 | │ ├─PX COORDINATOR | |1 |12 |
|6 | │ │ └─EXCHANGE OUT DISTR |:EX10000|1 |12 |
|7 | │ │ └─PX PARTITION ITERATOR | |1 |11 |
|8 | │ │ └─TABLE FULL SCAN |a |1 |11 |
|9 | │ └─HASH RIGHT SEMI JOIN | |1 |16 |
|10| │ ├─TABLE FULL SCAN |r |1 |3 |
|11| │ └─PX COORDINATOR | |2 |13 |
|12| │ └─EXCHANGE OUT DISTR |:EX20000|2 |12 |
|13| │ └─PX PARTITION ITERATOR| |2 |11 |
|14| │ └─TABLE FULL SCAN |a |2 |11 |
|15| └─TABLE FULL SCAN |s |3 |3 |
=========================================================================
Outputs & filters:
-------------------------------------
0 - output([s.acctnbr], [s.balcatcd], [s.baltypcd], [VIEW2.a.acctnbr], [VIEW2.a.curracctstatcd]), filter(nil), rowset=16
group([VIEW2.a.acctnbr]), agg_func(nil)
1 - output([VIEW2.a.acctnbr], [s.acctnbr], [s.balcatcd], [s.baltypcd], [VIEW2.a.curracctstatcd]), filter(nil), rowset=16
equal_conds([s.acctnbr = VIEW2.a.acctnbr]), other_conds(nil)
merge_directions([ASC])
2 - output([VIEW2.a.acctnbr], [VIEW2.a.curracctstatcd]), filter(nil), rowset=16
sort_keys([VIEW2.a.acctnbr, ASC])
3 - output([VIEW2.a.acctnbr], [VIEW2.a.curracctstatcd]), filter(nil), rowset=16
access([VIEW2.a.acctnbr], [VIEW2.a.curracctstatcd])
4 - output([UNION([1])], [UNION([2])]), filter(nil), rowset=16
5 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
6 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
dop=1
7 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
force partition granule
8 - output([a.acctnbr], [a.curracctstatcd]), filter([a.curracctstatcd != 'CLS']), rowset=16
access([a.acctnbr], [a.curracctstatcd]), partitions(p[0-4])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.acctnbr]), range(MIN ; MAX)always true
9 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
equal_conds([cast(r.acctnbr, DECIMAL(-1, -1)) = cast(a.acctnbr, DECIMAL(20, 0))]), other_conds(nil)
10 - output([r.acctnbr]), filter(nil), rowset=16
access([r.acctnbr]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([r.__pk_increment]), range(MIN ; MAX)always true
11 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
12 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
dop=1
13 - output([a.acctnbr], [a.curracctstatcd]), filter(nil), rowset=16
force partition granule
14 - output([a.acctnbr], [a.curracctstatcd]), filter([a.curracctstatcd = 'CLS']), rowset=16
access([a.acctnbr], [a.curracctstatcd]), partitions(p[0-4])
is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([a.acctnbr]), range(MIN ; MAX)always true
15 - output([s.acctnbr], [s.balcatcd], [s.baltypcd]), filter(nil), rowset=16
access([s.acctnbr], [s.balcatcd], [s.baltypcd]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([s.acctnbr], [s.balcatcd], [s.baltypcd]), range(MIN,MIN,MIN ; MAX,MAX,MAX)always true
drop database hualong;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,204 @@
#
# Bug#51457 Firstmatch semijoin strategy gives wrong results for
# certain query plans
#
drop table if exists t0, t1, t2, t3, t6, t8;
drop view if exists v1, v2, v3, v_t2, view_b, view_c;
CREATE TABLE t0(a INTEGER);
CREATE TABLE t1(a INTEGER);
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(a INTEGER);
INSERT INTO t2 VALUES(5), (8);
CREATE TABLE t6(a INTEGER);
INSERT INTO t6 VALUES(7), (1), (0), (5), (1), (4);
CREATE TABLE t8(a INTEGER);
INSERT INTO t8 VALUES(1), (3), (5), (7), (9), (7), (3), (1);
EXPLAIN
SELECT *
FROM t2 AS nt2
WHERE 1 IN (SELECT it1.a
FROM t1 AS it1 JOIN t6 AS it3 ON it1.a=it3.a);
Query Plan
====================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
--------------------------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN | |2 |3 |
|1 |├─TABLE FULL SCAN |nt2 |2 |3 |
|2 |└─MATERIAL | |1 |3 |
|3 | └─SUBPLAN SCAN |VIEW1|1 |3 |
|4 | └─LIMIT | |1 |3 |
|5 | └─NESTED-LOOP JOIN CARTESIAN | |1 |3 |
|6 | ├─SUBPLAN SCAN |VIEW2|1 |3 |
|7 | │ └─TABLE FULL SCAN |it1 |1 |3 |
|8 | └─MATERIAL | |1 |3 |
|9 | └─SUBPLAN SCAN |VIEW3|1 |3 |
|10| └─TABLE FULL SCAN |it3 |1 |3 |
====================================================================
Outputs & filters:
-------------------------------------
0 - output([nt2.a]), filter(nil), rowset=16
conds(nil), nl_params_(nil), use_batch=false
1 - output([nt2.a]), filter(nil), rowset=16
access([nt2.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([nt2.__pk_increment]), range(MIN ; MAX)always true
2 - output(nil), filter(nil), rowset=16
3 - output(nil), filter(nil), rowset=16
access(nil)
4 - output([1]), filter(nil), rowset=16
limit(1), offset(nil)
5 - output(nil), filter(nil), rowset=16
conds(nil), nl_params_(nil), use_batch=false
6 - output(nil), filter(nil), rowset=16
access(nil)
7 - output([1]), filter([it1.a = 1]), rowset=16
access([it1.a]), partitions(p0)
limit(1), offset(nil), is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([it1.__pk_increment]), range(MIN ; MAX)always true
8 - output(nil), filter(nil), rowset=16
9 - output(nil), filter(nil), rowset=16
access(nil)
10 - output([1]), filter([it3.a = 1]), rowset=16
access([it3.a]), partitions(p0)
limit(1), offset(nil), is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([it3.__pk_increment]), range(MIN ; MAX)always true
SELECT *
FROM t2 AS nt2
WHERE 1 IN (SELECT it1.a
FROM t1 AS it1 JOIN t6 AS it3 ON it1.a=it3.a);
a
5
8
EXPLAIN
SELECT *
FROM t2 AS nt2, t8 AS nt4
WHERE 1 IN (SELECT it1.a
FROM t1 AS it1 JOIN t6 AS it3 ON it1.a=it3.a);
Query Plan
========================================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
------------------------------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN | |16 |3 |
|1 |├─TABLE FULL SCAN |nt4 |8 |3 |
|2 |└─MATERIAL | |2 |3 |
|3 | └─NESTED-LOOP JOIN CARTESIAN | |2 |3 |
|4 | ├─TABLE FULL SCAN |nt2 |2 |3 |
|5 | └─MATERIAL | |1 |3 |
|6 | └─SUBPLAN SCAN |VIEW1|1 |3 |
|7 | └─LIMIT | |1 |3 |
|8 | └─NESTED-LOOP JOIN CARTESIAN | |1 |3 |
|9 | ├─SUBPLAN SCAN |VIEW2|1 |3 |
|10| │ └─TABLE FULL SCAN |it1 |1 |3 |
|11| └─MATERIAL | |1 |3 |
|12| └─SUBPLAN SCAN |VIEW3|1 |3 |
|13| └─TABLE FULL SCAN |it3 |1 |3 |
========================================================================
Outputs & filters:
-------------------------------------
0 - output([nt2.a], [nt4.a]), filter(nil), rowset=16
conds(nil), nl_params_(nil), use_batch=false
1 - output([nt4.a]), filter(nil), rowset=16
access([nt4.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([nt4.__pk_increment]), range(MIN ; MAX)always true
2 - output([nt2.a]), filter(nil), rowset=16
3 - output([nt2.a]), filter(nil), rowset=16
conds(nil), nl_params_(nil), use_batch=false
4 - output([nt2.a]), filter(nil), rowset=16
access([nt2.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([nt2.__pk_increment]), range(MIN ; MAX)always true
5 - output(nil), filter(nil), rowset=16
6 - output(nil), filter(nil), rowset=16
access(nil)
7 - output([1]), filter(nil), rowset=16
limit(1), offset(nil)
8 - output(nil), filter(nil), rowset=16
conds(nil), nl_params_(nil), use_batch=false
9 - output(nil), filter(nil), rowset=16
access(nil)
10 - output([1]), filter([it1.a = 1]), rowset=16
access([it1.a]), partitions(p0)
limit(1), offset(nil), is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([it1.__pk_increment]), range(MIN ; MAX)always true
11 - output(nil), filter(nil), rowset=16
12 - output(nil), filter(nil), rowset=16
access(nil)
13 - output([1]), filter([it3.a = 1]), rowset=16
access([it3.a]), partitions(p0)
limit(1), offset(nil), is_index_back=false, is_global_index=false, filter_before_indexback[false],
range_key([it3.__pk_increment]), range(MIN ; MAX)always true
SELECT *
FROM t2 AS nt2, t8 AS nt4
WHERE 1 IN (SELECT it1.a
FROM t1 AS it1 JOIN t6 AS it3 ON it1.a=it3.a);
a a
5 1
8 1
5 3
8 3
5 5
8 5
5 7
8 7
5 9
8 9
5 7
8 7
5 3
8 3
5 1
8 1
EXPLAIN
SELECT *
FROM t0 AS ot1, t2 AS nt3
WHERE ot1.a IN (SELECT it2.a
FROM t1 AS it2 JOIN t8 AS it4 ON it2.a=it4.a);
Query Plan
============================================================
|ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)|
------------------------------------------------------------
|0 |NESTED-LOOP JOIN CARTESIAN | |2 |3 |
|1 |├─TABLE FULL SCAN |nt3 |2 |3 |
|2 |└─MATERIAL | |1 |8 |
|3 | └─HASH SEMI JOIN | |1 |8 |
|4 | ├─TABLE FULL SCAN |ot1 |1 |3 |
|5 | └─SUBPLAN SCAN |VIEW1|2 |6 |
|6 | └─HASH JOIN | |2 |6 |
|7 | ├─TABLE FULL SCAN |it2 |1 |3 |
|8 | └─TABLE FULL SCAN |it4 |8 |3 |
============================================================
Outputs & filters:
-------------------------------------
0 - output([ot1.a], [nt3.a]), filter(nil), rowset=16
conds(nil), nl_params_(nil), use_batch=false
1 - output([nt3.a]), filter(nil), rowset=16
access([nt3.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([nt3.__pk_increment]), range(MIN ; MAX)always true
2 - output([ot1.a]), filter(nil), rowset=16
3 - output([ot1.a]), filter(nil), rowset=16
equal_conds([ot1.a = VIEW1.a]), other_conds(nil)
4 - output([ot1.a]), filter(nil), rowset=16
access([ot1.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([ot1.__pk_increment]), range(MIN ; MAX)always true
5 - output([VIEW1.a]), filter(nil), rowset=16
access([VIEW1.a])
6 - output([it2.a]), filter(nil), rowset=16
equal_conds([it2.a = it4.a]), other_conds(nil)
7 - output([it2.a]), filter(nil), rowset=16
access([it2.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([it2.__pk_increment]), range(MIN ; MAX)always true
8 - output([it4.a]), filter(nil), rowset=16
access([it4.a]), partitions(p0)
is_index_back=false, is_global_index=false,
range_key([it4.__pk_increment]), range(MIN ; MAX)always true
SELECT *
FROM t0 as ot1, t2 AS nt3
WHERE ot1.a IN (SELECT it2.a
FROM t1 AS it2 JOIN t8 AS it4 ON it2.a=it4.a);
a a
DROP TABLE t0, t1, t2, t6, t8;
# End of bug#51457