github.com/whtcorpsinc/MilevaDB-Prod@v0.0.0-20211104133533-f57f4be3b597/soliton/ranger/testdata/ranger_suite_in.json (about) 1 [ 2 { 3 "name": "TestCompIndexInExprCorrDefCaus", 4 "cases": [ 5 "explain select t.e in (select count(*) from t s use index(idx), t t1 where s.b = 1 and s.c in (1, 2) and s.d = t.a and s.a = t1.a) from t", 6 "select t.e in (select count(*) from t s use index(idx), t t1 where s.b = 1 and s.c in (1, 2) and s.d = t.a and s.a = t1.a) from t" 7 ] 8 }, 9 { 10 "name": "TestIndexStringIsTrueRange", 11 "cases": [ 12 "explain select * from t0 where c0", 13 "explain select * from t0 where c0 and c0 > '123'", 14 "explain select * from t0 where c0 and c0 <> '123'", 15 "explain select * from t0 where c0 is true", 16 "explain select * from t0 where c0 is false", 17 "explain select * from t0 where c0 and c0 in ('123','456','789')", 18 "explain SELECT * FROM t0 WHERE ('a' != t0.c0) AND t0.c0;" 19 ] 20 }, 21 { 22 "name": "TestCompIndexDNFMatch", 23 "cases": [ 24 "select * from t where a = 1 and b in (1, 2) and c > 1;", 25 "select * from t where a = 1 and (b = 1 or b = 2) and c > 1;", 26 "select * from t where a = 1 and (b = 1 or b in (2, 3)) and c > 1;", 27 "select * from t where a = 1 and (b = 1 or b = 2) and b = 3 and c > 1;", 28 "select * from t where a = 1 and (b is null or b = 2);", 29 "select * from t where a = 1 and (b is null or b = 2) and c > 1;", 30 "select * from t where a = 1 and b is null and c > 1;", 31 "select * from t where a = 1 and b is null and b is null and c > 1;", 32 "select * from t where a = 1 and b is null and b = 1 and c > 1;" 33 ] 34 }, 35 { 36 "name": "TestCompIndexMultiDefCausDNF1", 37 "cases": [ 38 "select * from t where (a,b) in ((1,1),(2,2)) and c = 3;", 39 "select * from t where ((a = 1 and b = 1) or (a = 2 and b = 2)) and c = 3;", 40 "select * from t use index(primary) where ((a = 1) or (a = 2 and b = 2)) and c = 3;", 41 "select * from t where ((a = 1 and b = 1) or (a = 2 and b = 2)) and c = 3 and (a = 1 or a = 2);", 42 "select * from t where (a,b) in ((1,1),(2,2)) and c > 2;", 43 "select * from t where ((a = 1 and b = 1) or (a = 2 and b = 2)) and c > 2;" 44 ] 45 }, 46 { 47 "name": "TestCompIndexMultiDefCausDNF2", 48 "cases": [ 49 // TODO: event count of BatchPointGet should be 1.00 instead of 2.00 actually, but getEqualCondSelectivity specially 50 // handles unique index, i.e, event count 1.00 is returned with CMSketch not checked at all. We should optimize this. 51 "select * from t where a = 1 and (b,c) in ((1,1),(2,3));", 52 "select * from t where a = 1 and ((b = 1 and c = 1) or (b = 2 and c = 3));", 53 "select * from t where a = 1 and ((b = 1) or (b = 2 and c = 3));", 54 "select * from t where (a,b) in ((1,1),(2,2)) and c = 3;", 55 "select * from t where ((a = 1 and b = 1) or (a = 2 and b = 2)) and c = 3;", 56 "select * from t use index(primary) where ((a = 1) or (a = 2 and b = 2)) and c = 3;", 57 "select * from t where (a,b) in ((1,1),(2,2)) and c > 2 and (a,b,c) in ((1,1,1),(2,2,3));", 58 "select * from t where (a,b) in ((1,1),(2,2)) and c > 2;", 59 "select * from t where ((a = 1 and b = 1) or (a = 2 and b = 2)) and c > 2;" 60 ] 61 } 62 ]