adding test scripts
[csql.git] / test / sql / Optimizer / hash_multiplepredicate.sql
blob005c53460b8e8e6c85af03552f71bc9a1fa9f36c
1 echo create table t1(f1 tinyint, f2 smallint, f3 int, f4 bigint, f5 char(10), f6 varchar(10), f7 date, f8 time);
2 create table t1(f1 tinyint, f2 smallint, f3 int, f4 bigint, f5 char(10), f6 varchar(10), f7 date, f8 time);
3 echo create index hashtiny on t1(f1) hash;
4 create index hashtiny on t1(f1) hash;
5 echo create index hashsmall on t1(f2) hash;
6 create index hashsmall on t1(f2) hash;
7 echo create index hashint on t1(f3) hash;
8 create index hashint on t1(f3) hash;
9 echo create index hashbig on t1(f4) hash;
10 create index hashbig on t1(f4) hash;
11 echo create index hashchar on t1(f5) hash;
12 create index hashchar on t1(f5) hash;
13 echo create index hashvarchar on t1(f6) hash;
14 create index hashvarchar on t1(f6) hash;
15 echo create index hashdate on t1(f7) hash;
16 create index hashdate on t1(f7) hash;
17 echo create index hashtime on t1(f8) hash;
18 create index hashtime on t1(f8) hash;
19 echo explain plan select * from t1;  
20 explain plan select * from t1;  
21 echo explain plan select * from t1 where f1 = 2 and f1 in (0,2,4) ;
22 explain plan select * from t1 where f1 = 2 and f1 in (0,2,4) ;
23 echo explain plan select * from t1 where f1 = 3 or (f1  between 2 and 4);
24 explain plan select * from t1 where f1 = 3 or (f1  between 2 and 4);
25 echo explain plan select * from t1 where f2 in (0,2,4) and f2 = 2;
26 explain plan select * from t1 where f2 in (0,2,4) and f2 = 2;
27 echo explain plan select * from t1 where (f2 between 2 and 4) or f2 = 2;
28 explain plan select * from t1 where (f2 between 2 and 4) or f2 = 2;
29 echo explain plan select * from t1 where f3 = 2 or f3 in (1,2) ;
30 explain plan select * from t1 where f3 = 2 or f3 in (1,2) ;
31 echo explain plan select * from t1 where f3 = 2 and f3 between 1 and 4;
32 explain plan select * from t1 where f3 = 2 and f3 between 1 and 4;
33 echo explain plan select * from t1 where f4 in (1,2) or f4 = 2;
34 explain plan select * from t1 where f4 in (1,2) or f4 = 2;
35 echo explain plan select * from t1 where (f4 between 1 and 4) and f4 = 2;
36 explain plan select * from t1 where (f4 between 1 and 4) and f4 = 2;
37 echo explain plan select * from t1 where f5 in ('1','2') and f5 = '1';
38 explain plan select * from t1 where f5 in ('1','2') and f5 = '1';
39 echo explain plan select * from t1 where f5 like 'N%' or f5 = 'NP';
40 explain plan select * from t1 where f5 like 'N%' or f5 = 'NP';
41 echo explain plan select * from t1 where f5 like 'N_h' and f6 = 'Nihar';
42 explain plan select * from t1 where f5 like 'N_h' and f6 = 'Nihar';
43 echo explain plan select * from t1 where f6 = '1' or f6 in ('1','2');
44 explain plan select * from t1 where f6 = '1' or f6 in ('1','2');
45 echo explain plan select * from t1 where f6 = 'NP' or f6 like 'N%';
46 explain plan select * from t1 where f6 = 'NP' or f6 like 'N%';
47 echo explain plan select * from t1 where f6 like 'N_h' and f6 = 'NIHAR';
48 explain plan select * from t1 where f6 like 'N_h' and f6 = 'NIHAR';
49 echo explain plan select * from t1 where f7 = '2003-11-12' or f7 in ('2003-11-12','2003-11-15');
50 explain plan select * from t1 where f7 = '2003-11-12' or f7 in ('2003-11-12','2003-11-15');
51 echo explain plan select * from t1 where f7 = '2003-11-15' and (f7 between '2003-11-12' and '2003-11-15');
52 explain plan select * from t1 where f7 = '2003-11-15' and (f7 between '2003-11-12' and '2003-11-15');
53 echo explain plan select * from t1 where f8 in ('03:21:00','03:21:08') and f8 = '03:21:08';
54 explain plan select * from t1 where f8 in ('03:21:00','03:21:08') and f8 = '03:21:08';
55 echo explain plan select * from t1 where (f8 between '03:21:00' and '03:21:08') or f8='03:21:00';
56 explain plan select * from t1 where (f8 between '03:21:00' and '03:21:08') or f8='03:21:00';