1 echo create table t1
(f1 smallint
, f2 int
, f3 bigint
, f4 varchar
, f5
date);
3 echo create index compositehashindex on t1
(f2
,f3
,f4
,f5
) hash;
5 echo explain plan
select * from t1
;
8 <ScanType
> TableScan
</ScanType
>
10 echo explain plan
select * from t1 where f2
=1 and f3
=10 and f4
='abc' and f5
='2001-01-01';
13 <ScanType
> TableScan
</ScanType
>
24 <FieldName1
> f2
</FieldName1
>
25 <CompOp
> Equals
</CompOp
>
26 <OperandPtr
> VALUE
</OperandPtr
>
31 <FieldName1
> f3
</FieldName1
>
32 <CompOp
> Equals
</CompOp
>
33 <OperandPtr
> VALUE
</OperandPtr
>
40 <FieldName1
> f4
</FieldName1
>
41 <CompOp
> Equals
</CompOp
>
42 <OperandPtr
> VALUE
</OperandPtr
>
49 <FieldName1
> f5
</FieldName1
>
50 <CompOp
> Equals
</CompOp
>
51 <OperandPtr
> VALUE
</OperandPtr
>
56 echo explain plan
select * from t1 where f2
=1 and f3
=10 and f4
='abc' and f5
='2001-01-01';
59 <ScanType
> TableScan
</ScanType
>
70 <FieldName1
> f2
</FieldName1
>
71 <CompOp
> Equals
</CompOp
>
72 <OperandPtr
> VALUE
</OperandPtr
>
77 <FieldName1
> f3
</FieldName1
>
78 <CompOp
> Equals
</CompOp
>
79 <OperandPtr
> VALUE
</OperandPtr
>
86 <FieldName1
> f4
</FieldName1
>
87 <CompOp
> Equals
</CompOp
>
88 <OperandPtr
> VALUE
</OperandPtr
>
95 <FieldName1
> f5
</FieldName1
>
96 <CompOp
> Equals
</CompOp
>
97 <OperandPtr
> VALUE
</OperandPtr
>
102 echo explain plan
select * from t1 where f2
<=10 and f3
>=10 and f4 like
'abc%' and f5
in ('2001-01-01','2001-03-03');
105 <ScanType
> TableScan
</ScanType
>
116 <FieldName1
> f2
</FieldName1
>
117 <CompOp
> LessThanEquals
</CompOp
>
118 <OperandPtr
> VALUE
</OperandPtr
>
123 <FieldName1
> f3
</FieldName1
>
124 <CompOp
> GreaterThanEquals
</CompOp
>
125 <OperandPtr
> VALUE
</OperandPtr
>
132 <FieldName1
> f4
</FieldName1
>
133 <CompOp
> Like
</CompOp
>
134 <OperandPtr
> VALUE
</OperandPtr
>
144 <FieldName1
> f5
</FieldName1
>
145 <CompOp
> Equals
</CompOp
>
146 <OperandPtr
> VALUE
</OperandPtr
>
151 <FieldName1
> f5
</FieldName1
>
152 <CompOp
> Equals
</CompOp
>
153 <OperandPtr
> VALUE
</OperandPtr
>
160 echo explain plan
select * from t1 where f2
<=10 and f3
>=10 and f4 like
'abc%' and f5
in ('2001-01-01','2001-03-03');
163 <ScanType
> TableScan
</ScanType
>
174 <FieldName1
> f2
</FieldName1
>
175 <CompOp
> LessThanEquals
</CompOp
>
176 <OperandPtr
> VALUE
</OperandPtr
>
181 <FieldName1
> f3
</FieldName1
>
182 <CompOp
> GreaterThanEquals
</CompOp
>
183 <OperandPtr
> VALUE
</OperandPtr
>
190 <FieldName1
> f4
</FieldName1
>
191 <CompOp
> Like
</CompOp
>
192 <OperandPtr
> VALUE
</OperandPtr
>
202 <FieldName1
> f5
</FieldName1
>
203 <CompOp
> Equals
</CompOp
>
204 <OperandPtr
> VALUE
</OperandPtr
>
209 <FieldName1
> f5
</FieldName1
>
210 <CompOp
> Equals
</CompOp
>
211 <OperandPtr
> VALUE
</OperandPtr
>
218 echo explain plan
select * from t1 where f2
<=10 or f3
>=10 or f4 like
'abc%' or f5
in ('2001-01-01','2001-03-03');
221 <ScanType
> TableScan
</ScanType
>
232 <FieldName1
> f2
</FieldName1
>
233 <CompOp
> LessThanEquals
</CompOp
>
234 <OperandPtr
> VALUE
</OperandPtr
>
239 <FieldName1
> f3
</FieldName1
>
240 <CompOp
> GreaterThanEquals
</CompOp
>
241 <OperandPtr
> VALUE
</OperandPtr
>
248 <FieldName1
> f4
</FieldName1
>
249 <CompOp
> Like
</CompOp
>
250 <OperandPtr
> VALUE
</OperandPtr
>
260 <FieldName1
> f5
</FieldName1
>
261 <CompOp
> Equals
</CompOp
>
262 <OperandPtr
> VALUE
</OperandPtr
>
267 <FieldName1
> f5
</FieldName1
>
268 <CompOp
> Equals
</CompOp
>
269 <OperandPtr
> VALUE
</OperandPtr
>
276 echo explain plan
select * from t1 where f2
<=10 or f3
>=10 or f4 like
'abc%' or f5
in ('2001-01-01','2001-03-03');
279 <ScanType
> TableScan
</ScanType
>
290 <FieldName1
> f2
</FieldName1
>
291 <CompOp
> LessThanEquals
</CompOp
>
292 <OperandPtr
> VALUE
</OperandPtr
>
297 <FieldName1
> f3
</FieldName1
>
298 <CompOp
> GreaterThanEquals
</CompOp
>
299 <OperandPtr
> VALUE
</OperandPtr
>
306 <FieldName1
> f4
</FieldName1
>
307 <CompOp
> Like
</CompOp
>
308 <OperandPtr
> VALUE
</OperandPtr
>
318 <FieldName1
> f5
</FieldName1
>
319 <CompOp
> Equals
</CompOp
>
320 <OperandPtr
> VALUE
</OperandPtr
>
325 <FieldName1
> f5
</FieldName1
>
326 <CompOp
> Equals
</CompOp
>
327 <OperandPtr
> VALUE
</OperandPtr
>