File: desc_index.out

package info (click to toggle)
derby 10.14.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 79,056 kB
  • sloc: java: 691,961; sql: 42,686; xml: 20,512; sh: 3,373; sed: 96; makefile: 60
file content (1019 lines) | stat: -rw-r--r-- 66,522 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
ij> --
--   Licensed to the Apache Software Foundation (ASF) under one or more
--   contributor license agreements.  See the NOTICE file distributed with
--   this work for additional information regarding copyright ownership.
--   The ASF licenses this file to You under the Apache License, Version 2.0
--   (the "License"); you may not use this file except in compliance with
--   the License.  You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
--   Unless required by applicable law or agreed to in writing, software
--   distributed under the License is distributed on an "AS IS" BASIS,
--   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--   See the License for the specific language governing permissions and
--   limitations under the License.
--
-- this also tests multiple indexes share one conglomerate if they essentially
-- are the same
autocommit off;
ij> create table tab1 (c1 int, c2 smallint, c3 double precision, c4 varchar(30),
		   c5 varchar(1024));
0 rows inserted/updated/deleted
ij> insert into tab1 values (8, 12, 5.6, 'dfg', 'ghji');
1 row inserted/updated/deleted
ij> insert into tab1 values (76, 2, -9.86, 'yudf', '45gd');
1 row inserted/updated/deleted
ij> insert into tab1 values (-78, 45, -5.6, 'jakdsfh', 'df89g');
1 row inserted/updated/deleted
ij> insert into tab1 values (56, -3, 6.7, 'dfgs', 'fds');
1 row inserted/updated/deleted
ij> create index i1 on tab1 (c1, c3, c4);
0 rows inserted/updated/deleted
ij> create index i2 on tab1 (c1 desc, c3 desc, c4 desc);
0 rows inserted/updated/deleted
ij> create index i3 on tab1 (c1 desc, c3 asc, c4 desc);
0 rows inserted/updated/deleted
ij> create index i4 on tab1 (c2 desc, c3, c1);
0 rows inserted/updated/deleted
ij> create index i5 on tab1 (c1, c2 desc);
0 rows inserted/updated/deleted
ij> insert into tab1 values (34, 67, 5.3, 'rtgd', 'hds');
1 row inserted/updated/deleted
ij> insert into tab1 values (100, 11, 9.0, '34sfg', 'ayupo');
1 row inserted/updated/deleted
ij> insert into tab1 values (-100, 93, 9.1, 'egfh', 's6j');
1 row inserted/updated/deleted
ij> insert into tab1 values (55, 44, -9.85, 'yudd', 'df89f');
1 row inserted/updated/deleted
ij> insert into tab1 values (34, 68, 2.7, 'srg', 'iur');
1 row inserted/updated/deleted
ij> insert into tab1 values (34, 66, 1.2, 'yty', 'wer');
1 row inserted/updated/deleted
ij> call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);
0 rows inserted/updated/deleted
ij> maximumdisplaywidth 20000;
ij> -- should use index i4
select c1, c3 from tab1 where c2 > 40 and c3 <= 5.3;
C1         |C3                      
------------------------------------
34         |2.7                     
34         |5.3                     
34         |1.2                     
-78        |-5.6                    
55         |-9.85                   
ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Statement Name: 
	null
Statement Text: 
	-- should use index i4
select c1, c3 from tab1 where c2 > 40 and c3 <= 5.3
Parse Time: 0
Bind Time: 0
Optimize Time: 0
Generate Time: 0
Compile Time: 0
Execute Time: 0
Begin Compilation Timestamp : null
End Compilation Timestamp : null
Begin Execution Timestamp : null
End Execution Timestamp : null
Statement Execution Plan Text: 
Project-Restrict ResultSet (3):
Number of opens = 1
Rows seen = 5
Rows filtered = 0
restriction = false
projection = true
	constructor time (milliseconds) = 0
	open time (milliseconds) = 0
	next time (milliseconds) = 0
	close time (milliseconds) = 0
	restriction time (milliseconds) = 0
	projection time (milliseconds) = 0
Source result set:
	Project-Restrict ResultSet (2):
	Number of opens = 1
	Rows seen = 5
	Rows filtered = 0
	restriction = false
	projection = true
		constructor time (milliseconds) = 0
		open time (milliseconds) = 0
		next time (milliseconds) = 0
		close time (milliseconds) = 0
		restriction time (milliseconds) = 0
		projection time (milliseconds) = 0
	Source result set:
		Index Scan ResultSet for TAB1 using index I4 at read committed isolation level using instantaneous share row locking chosen by the optimizer
		Number of opens = 1
		Rows seen = 5
		Rows filtered = 0
		Fetch Size = 16
			constructor time (milliseconds) = 0
			open time (milliseconds) = 0
			next time (milliseconds) = 0
			close time (milliseconds) = 0
			next time in milliseconds/row = 0
		scan information:
			Bit set of columns fetched={0, 1, 2}
			Number of columns fetched=3
			Number of deleted rows visited=0
			Number of pages visited=1
			Number of rows qualified=5
			Number of rows visited=7
			Scan type=btree
			Tree height=1
			start position:
				None
			stop position:
				>= on first 1 column(s).
				Ordered null semantics on the following columns: 
			qualifiers:
				Column[0][0] Id: 1
				Operator: <=
				Ordered nulls: false
				Unknown return value: false
				Negate comparison result: false
ij> -- should use index i5
select c2, c1 from tab1 where c2 <= 44 and c1 > 55;
C2    |C1         
------------------
-3    |56         
2     |76         
11    |100        
ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Statement Name: 
	null
Statement Text: 
	-- should use index i5
select c2, c1 from tab1 where c2 <= 44 and c1 > 55
Parse Time: 0
Bind Time: 0
Optimize Time: 0
Generate Time: 0
Compile Time: 0
Execute Time: 0
Begin Compilation Timestamp : null
End Compilation Timestamp : null
Begin Execution Timestamp : null
End Execution Timestamp : null
Statement Execution Plan Text: 
Project-Restrict ResultSet (2):
Number of opens = 1
Rows seen = 3
Rows filtered = 0
restriction = false
projection = true
	constructor time (milliseconds) = 0
	open time (milliseconds) = 0
	next time (milliseconds) = 0
	close time (milliseconds) = 0
	restriction time (milliseconds) = 0
	projection time (milliseconds) = 0
Source result set:
	Index Scan ResultSet for TAB1 using index I5 at read committed isolation level using instantaneous share row locking chosen by the optimizer
	Number of opens = 1
	Rows seen = 3
	Rows filtered = 0
	Fetch Size = 16
		constructor time (milliseconds) = 0
		open time (milliseconds) = 0
		next time (milliseconds) = 0
		close time (milliseconds) = 0
		next time in milliseconds/row = 0
	scan information:
		Bit set of columns fetched={0, 1}
		Number of columns fetched=2
		Number of deleted rows visited=0
		Number of pages visited=1
		Number of rows qualified=3
		Number of rows visited=3
		Scan type=btree
		Tree height=1
		start position:
			> on first 1 column(s).
			Ordered null semantics on the following columns: 
		stop position:
			None
		qualifiers:
			Column[0][0] Id: 1
			Operator: <=
			Ordered nulls: false
			Unknown return value: false
			Negate comparison result: false
ij> -- should use i1
select c1, c3, c4 from tab1 order by c1, c3;
C1         |C3                      |C4                            
-------------------------------------------------------------------
-100       |9.1                     |egfh                          
-78        |-5.6                    |jakdsfh                       
8          |5.6                     |dfg                           
34         |1.2                     |yty                           
34         |2.7                     |srg                           
34         |5.3                     |rtgd                          
55         |-9.85                   |yudd                          
56         |6.7                     |dfgs                          
76         |-9.86                   |yudf                          
100        |9.0                     |34sfg                         
ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Statement Name: 
	null
Statement Text: 
	-- should use i1
select c1, c3, c4 from tab1 order by c1, c3
Parse Time: 0
Bind Time: 0
Optimize Time: 0
Generate Time: 0
Compile Time: 0
Execute Time: 0
Begin Compilation Timestamp : null
End Compilation Timestamp : null
Begin Execution Timestamp : null
End Execution Timestamp : null
Statement Execution Plan Text: 
Index Scan ResultSet for TAB1 using index I1 at read committed isolation level using instantaneous share row locking chosen by the optimizer
Number of opens = 1
Rows seen = 10
Rows filtered = 0
Fetch Size = 16
	constructor time (milliseconds) = 0
	open time (milliseconds) = 0
	next time (milliseconds) = 0
	close time (milliseconds) = 0
	next time in milliseconds/row = 0
scan information:
	Bit set of columns fetched={0, 1, 2}
	Number of columns fetched=3
	Number of deleted rows visited=0
	Number of pages visited=1
	Number of rows qualified=10
	Number of rows visited=10
	Scan type=btree
	Tree height=1
	start position:
		None
	stop position:
		None
	qualifiers:
		None
ij> -- should use i2
select c1, c3, c4 from tab1 order by c1 desc, c3 desc, c4 desc;
C1         |C3                      |C4                            
-------------------------------------------------------------------
100        |9.0                     |34sfg                         
76         |-9.86                   |yudf                          
56         |6.7                     |dfgs                          
55         |-9.85                   |yudd                          
34         |5.3                     |rtgd                          
34         |2.7                     |srg                           
34         |1.2                     |yty                           
8          |5.6                     |dfg                           
-78        |-5.6                    |jakdsfh                       
-100       |9.1                     |egfh                          
ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Statement Name: 
	null
Statement Text: 
	-- should use i2
select c1, c3, c4 from tab1 order by c1 desc, c3 desc, c4 desc
Parse Time: 0
Bind Time: 0
Optimize Time: 0
Generate Time: 0
Compile Time: 0
Execute Time: 0
Begin Compilation Timestamp : null
End Compilation Timestamp : null
Begin Execution Timestamp : null
End Execution Timestamp : null
Statement Execution Plan Text: 
Index Scan ResultSet for TAB1 using index I2 at read committed isolation level using instantaneous share row locking chosen by the optimizer
Number of opens = 1
Rows seen = 10
Rows filtered = 0
Fetch Size = 16
	constructor time (milliseconds) = 0
	open time (milliseconds) = 0
	next time (milliseconds) = 0
	close time (milliseconds) = 0
	next time in milliseconds/row = 0
scan information:
	Bit set of columns fetched={0, 1, 2}
	Number of columns fetched=3
	Number of deleted rows visited=0
	Number of pages visited=1
	Number of rows qualified=10
	Number of rows visited=10
	Scan type=btree
	Tree height=1
	start position:
		None
	stop position:
		None
	qualifiers:
		None
ij> -- should use i3
select c1, c3, c4 from tab1 order by c1 desc, c3 asc, c4 desc;
C1         |C3                      |C4                            
-------------------------------------------------------------------
100        |9.0                     |34sfg                         
76         |-9.86                   |yudf                          
56         |6.7                     |dfgs                          
55         |-9.85                   |yudd                          
34         |1.2                     |yty                           
34         |2.7                     |srg                           
34         |5.3                     |rtgd                          
8          |5.6                     |dfg                           
-78        |-5.6                    |jakdsfh                       
-100       |9.1                     |egfh                          
ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Statement Name: 
	null
Statement Text: 
	-- should use i3
select c1, c3, c4 from tab1 order by c1 desc, c3 asc, c4 desc
Parse Time: 0
Bind Time: 0
Optimize Time: 0
Generate Time: 0
Compile Time: 0
Execute Time: 0
Begin Compilation Timestamp : null
End Compilation Timestamp : null
Begin Execution Timestamp : null
End Execution Timestamp : null
Statement Execution Plan Text: 
Index Scan ResultSet for TAB1 using index I3 at read committed isolation level using instantaneous share row locking chosen by the optimizer
Number of opens = 1
Rows seen = 10
Rows filtered = 0
Fetch Size = 16
	constructor time (milliseconds) = 0
	open time (milliseconds) = 0
	next time (milliseconds) = 0
	close time (milliseconds) = 0
	next time in milliseconds/row = 0
scan information:
	Bit set of columns fetched={0, 1, 2}
	Number of columns fetched=3
	Number of deleted rows visited=0
	Number of pages visited=1
	Number of rows qualified=10
	Number of rows visited=10
	Scan type=btree
	Tree height=1
	start position:
		None
	stop position:
		None
	qualifiers:
		None
ij> -- should use i4
select c1, c2, c3 from tab1 order by c2 desc, c3 asc;
C1         |C2    |C3                      
-------------------------------------------
-100       |93    |9.1                     
34         |68    |2.7                     
34         |67    |5.3                     
34         |66    |1.2                     
-78        |45    |-5.6                    
55         |44    |-9.85                   
8          |12    |5.6                     
100        |11    |9.0                     
76         |2     |-9.86                   
56         |-3    |6.7                     
ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Statement Name: 
	null
Statement Text: 
	-- should use i4
select c1, c2, c3 from tab1 order by c2 desc, c3 asc
Parse Time: 0
Bind Time: 0
Optimize Time: 0
Generate Time: 0
Compile Time: 0
Execute Time: 0
Begin Compilation Timestamp : null
End Compilation Timestamp : null
Begin Execution Timestamp : null
End Execution Timestamp : null
Statement Execution Plan Text: 
Project-Restrict ResultSet (2):
Number of opens = 1
Rows seen = 10
Rows filtered = 0
restriction = false
projection = true
	constructor time (milliseconds) = 0
	open time (milliseconds) = 0
	next time (milliseconds) = 0
	close time (milliseconds) = 0
	restriction time (milliseconds) = 0
	projection time (milliseconds) = 0
Source result set:
	Index Scan ResultSet for TAB1 using index I4 at read committed isolation level using instantaneous share row locking chosen by the optimizer
	Number of opens = 1
	Rows seen = 10
	Rows filtered = 0
	Fetch Size = 16
		constructor time (milliseconds) = 0
		open time (milliseconds) = 0
		next time (milliseconds) = 0
		close time (milliseconds) = 0
		next time in milliseconds/row = 0
	scan information:
		Bit set of columns fetched={0, 1, 2}
		Number of columns fetched=3
		Number of deleted rows visited=0
		Number of pages visited=1
		Number of rows qualified=10
		Number of rows visited=10
		Scan type=btree
		Tree height=1
		start position:
			None
		stop position:
			None
		qualifiers:
			None
ij> -- should use i5
select c1, c2 from tab1 order by c1, c2 desc;
C1         |C2    
------------------
-100       |93    
-78        |45    
8          |12    
34         |68    
34         |67    
34         |66    
55         |44    
56         |-3    
76         |2     
100        |11    
ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Statement Name: 
	null
Statement Text: 
	-- should use i5
select c1, c2 from tab1 order by c1, c2 desc
Parse Time: 0
Bind Time: 0
Optimize Time: 0
Generate Time: 0
Compile Time: 0
Execute Time: 0
Begin Compilation Timestamp : null
End Compilation Timestamp : null
Begin Execution Timestamp : null
End Execution Timestamp : null
Statement Execution Plan Text: 
Index Scan ResultSet for TAB1 using index I5 at read committed isolation level using instantaneous share row locking chosen by the optimizer
Number of opens = 1
Rows seen = 10
Rows filtered = 0
Fetch Size = 16
	constructor time (milliseconds) = 0
	open time (milliseconds) = 0
	next time (milliseconds) = 0
	close time (milliseconds) = 0
	next time in milliseconds/row = 0
scan information:
	Bit set of columns fetched={0, 1}
	Number of columns fetched=2
	Number of deleted rows visited=0
	Number of pages visited=1
	Number of rows qualified=10
	Number of rows visited=10
	Scan type=btree
	Tree height=1
	start position:
		None
	stop position:
		None
	qualifiers:
		None
ij> -- should use i4
select max(c2) from tab1;
1     
------
93    
ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Statement Name: 
	null
Statement Text: 
	-- should use i4
select max(c2) from tab1
Parse Time: 0
Bind Time: 0
Optimize Time: 0
Generate Time: 0
Compile Time: 0
Execute Time: 0
Begin Compilation Timestamp : null
End Compilation Timestamp : null
Begin Execution Timestamp : null
End Execution Timestamp : null
Statement Execution Plan Text: 
Project-Restrict ResultSet (4):
Number of opens = 1
Rows seen = 1
Rows filtered = 0
restriction = false
projection = true
	constructor time (milliseconds) = 0
	open time (milliseconds) = 0
	next time (milliseconds) = 0
	close time (milliseconds) = 0
	restriction time (milliseconds) = 0
	projection time (milliseconds) = 0
Source result set:
	Scalar Aggregate ResultSet:
	Number of opens = 1
	Rows input = 1
		constructor time (milliseconds) = 0
		open time (milliseconds) = 0
		next time (milliseconds) = 0
		close time (milliseconds) = 0
	Index Key Optimization = true
	Source result set:
		Project-Restrict ResultSet (3):
		Number of opens = 1
		Rows seen = 1
		Rows filtered = 0
		restriction = false
		projection = true
			constructor time (milliseconds) = 0
			open time (milliseconds) = 0
			next time (milliseconds) = 0
			close time (milliseconds) = 0
			restriction time (milliseconds) = 0
			projection time (milliseconds) = 0
		Source result set:
			Index Scan ResultSet for TAB1 using index I4 at read committed isolation level using share row locking chosen by the optimizer
			Number of opens = 1
			Rows seen = 1
			Rows filtered = 0
			Fetch Size = 1
				constructor time (milliseconds) = 0
				open time (milliseconds) = 0
				next time (milliseconds) = 0
				close time (milliseconds) = 0
				next time in milliseconds/row = 0
			scan information:
				Bit set of columns fetched={0}
				Number of columns fetched=1
				Number of deleted rows visited=0
				Number of pages visited=1
				Number of rows qualified=1
				Number of rows visited=1
				Scan type=btree
				Tree height=1
				start position:
					None
				stop position:
					None
				qualifiers:
					None
ij> -- should use i4
select min(c2) from tab1;
1     
------
-3    
ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Statement Name: 
	null
Statement Text: 
	-- should use i4
select min(c2) from tab1
Parse Time: 0
Bind Time: 0
Optimize Time: 0
Generate Time: 0
Compile Time: 0
Execute Time: 0
Begin Compilation Timestamp : null
End Compilation Timestamp : null
Begin Execution Timestamp : null
End Execution Timestamp : null
Statement Execution Plan Text: 
Project-Restrict ResultSet (4):
Number of opens = 1
Rows seen = 1
Rows filtered = 0
restriction = false
projection = true
	constructor time (milliseconds) = 0
	open time (milliseconds) = 0
	next time (milliseconds) = 0
	close time (milliseconds) = 0
	restriction time (milliseconds) = 0
	projection time (milliseconds) = 0
Source result set:
	Scalar Aggregate ResultSet:
	Number of opens = 1
	Rows input = 1
		constructor time (milliseconds) = 0
		open time (milliseconds) = 0
		next time (milliseconds) = 0
		close time (milliseconds) = 0
	Index Key Optimization = true
	Source result set:
		Project-Restrict ResultSet (3):
		Number of opens = 1
		Rows seen = 1
		Rows filtered = 0
		restriction = false
		projection = true
			constructor time (milliseconds) = 0
			open time (milliseconds) = 0
			next time (milliseconds) = 0
			close time (milliseconds) = 0
			restriction time (milliseconds) = 0
			projection time (milliseconds) = 0
		Source result set:
			Last Key Index Scan ResultSet for TAB1 using index I4at read committed isolation level using share row locking chosen by the optimizer
			Number of opens = 1
			Rows seen = 1
				constructor time (milliseconds) = 0
				open time (milliseconds) = 0
				next time (milliseconds) = 0
				close time (milliseconds) = 0
				next time in milliseconds/row = 0
ij> -- should use i5
select min(c2) from tab1 where c1 = 34;
1     
------
66    
ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Statement Name: 
	null
Statement Text: 
	-- should use i5
select min(c2) from tab1 where c1 = 34
Parse Time: 0
Bind Time: 0
Optimize Time: 0
Generate Time: 0
Compile Time: 0
Execute Time: 0
Begin Compilation Timestamp : null
End Compilation Timestamp : null
Begin Execution Timestamp : null
End Execution Timestamp : null
Statement Execution Plan Text: 
Project-Restrict ResultSet (4):
Number of opens = 1
Rows seen = 1
Rows filtered = 0
restriction = false
projection = true
	constructor time (milliseconds) = 0
	open time (milliseconds) = 0
	next time (milliseconds) = 0
	close time (milliseconds) = 0
	restriction time (milliseconds) = 0
	projection time (milliseconds) = 0
Source result set:
	Scalar Aggregate ResultSet:
	Number of opens = 1
	Rows input = 3
		constructor time (milliseconds) = 0
		open time (milliseconds) = 0
		next time (milliseconds) = 0
		close time (milliseconds) = 0
	Index Key Optimization = false
	Source result set:
		Project-Restrict ResultSet (3):
		Number of opens = 1
		Rows seen = 3
		Rows filtered = 0
		restriction = false
		projection = true
			constructor time (milliseconds) = 0
			open time (milliseconds) = 0
			next time (milliseconds) = 0
			close time (milliseconds) = 0
			restriction time (milliseconds) = 0
			projection time (milliseconds) = 0
		Source result set:
			Index Scan ResultSet for TAB1 using index I5 at read committed isolation level using instantaneous share row locking chosen by the optimizer
			Number of opens = 1
			Rows seen = 3
			Rows filtered = 0
			Fetch Size = 16
				constructor time (milliseconds) = 0
				open time (milliseconds) = 0
				next time (milliseconds) = 0
				close time (milliseconds) = 0
				next time in milliseconds/row = 0
			scan information:
				Bit set of columns fetched={0, 1}
				Number of columns fetched=2
				Number of deleted rows visited=0
				Number of pages visited=1
				Number of rows qualified=3
				Number of rows visited=4
				Scan type=btree
				Tree height=1
				start position:
					>= on first 1 column(s).
					Ordered null semantics on the following columns: 
				stop position:
					> on first 1 column(s).
					Ordered null semantics on the following columns: 
				qualifiers:
					None
ij> -- should use i5
select max(c2) from tab1 where c1 = 34;
1     
------
68    
ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Statement Name: 
	null
Statement Text: 
	-- should use i5
select max(c2) from tab1 where c1 = 34
Parse Time: 0
Bind Time: 0
Optimize Time: 0
Generate Time: 0
Compile Time: 0
Execute Time: 0
Begin Compilation Timestamp : null
End Compilation Timestamp : null
Begin Execution Timestamp : null
End Execution Timestamp : null
Statement Execution Plan Text: 
Project-Restrict ResultSet (4):
Number of opens = 1
Rows seen = 1
Rows filtered = 0
restriction = false
projection = true
	constructor time (milliseconds) = 0
	open time (milliseconds) = 0
	next time (milliseconds) = 0
	close time (milliseconds) = 0
	restriction time (milliseconds) = 0
	projection time (milliseconds) = 0
Source result set:
	Scalar Aggregate ResultSet:
	Number of opens = 1
	Rows input = 1
		constructor time (milliseconds) = 0
		open time (milliseconds) = 0
		next time (milliseconds) = 0
		close time (milliseconds) = 0
	Index Key Optimization = true
	Source result set:
		Project-Restrict ResultSet (3):
		Number of opens = 1
		Rows seen = 1
		Rows filtered = 0
		restriction = false
		projection = true
			constructor time (milliseconds) = 0
			open time (milliseconds) = 0
			next time (milliseconds) = 0
			close time (milliseconds) = 0
			restriction time (milliseconds) = 0
			projection time (milliseconds) = 0
		Source result set:
			Index Scan ResultSet for TAB1 using index I5 at read committed isolation level using share row locking chosen by the optimizer
			Number of opens = 1
			Rows seen = 1
			Rows filtered = 0
			Fetch Size = 1
				constructor time (milliseconds) = 0
				open time (milliseconds) = 0
				next time (milliseconds) = 0
				close time (milliseconds) = 0
				next time in milliseconds/row = 0
			scan information:
				Bit set of columns fetched={0, 1}
				Number of columns fetched=2
				Number of deleted rows visited=0
				Number of pages visited=1
				Number of rows qualified=1
				Number of rows visited=1
				Scan type=btree
				Tree height=1
				start position:
					>= on first 1 column(s).
					Ordered null semantics on the following columns: 
				stop position:
					> on first 1 column(s).
					Ordered null semantics on the following columns: 
				qualifiers:
					None
ij> -- test if bulk insert rebuilds desc index right
call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'TAB1', 0);
0 rows inserted/updated/deleted
ij> select * from tab1 order by c1 desc;
C1         |C2    |C3                      |C4                            |C5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
100        |11    |9.0                     |34sfg                         |ayupo                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
76         |2     |-9.86                   |yudf                          |45gd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
56         |-3    |6.7                     |dfgs                          |fds                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
55         |44    |-9.85                   |yudd                          |df89f                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
34         |66    |1.2                     |yty                           |wer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
34         |68    |2.7                     |srg                           |iur                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
34         |67    |5.3                     |rtgd                          |hds                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
8          |12    |5.6                     |dfg                           |ghji                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
-78        |45    |-5.6                    |jakdsfh                       |df89g                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
-100       |93    |9.1                     |egfh                          |s6j                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
ij> -- this tests multiple indexes share one conglomerate if they essentially
-- are the same
create table tab2 (c1 int not null primary key, c2 int, c3 int);
0 rows inserted/updated/deleted
ij> -- not unique index, shouldn't share with primary key's index
create index i21 on tab2(c1);
0 rows inserted/updated/deleted
WARNING 01504: 'I21' index not created because it is a duplicate of an existing index: 'xxxxGENERATED-IDxxxx'.
ij> -- desc index, shouldn't share with primary key's index
create index i22 on tab2(c1 desc);
0 rows inserted/updated/deleted
ij> -- this should share with primary key's index, and give a warning
create unique index i23 on tab2(c1);
0 rows inserted/updated/deleted
WARNING 01504: 'I23' index not created because it is a duplicate of an existing index: 'xxxxGENERATED-IDxxxx'.
ij> create index i24 on tab2(c1, c3 desc);
0 rows inserted/updated/deleted
ij> -- this should share with i24's conglomerate
create index i25 on tab2(c1, c3 desc);
0 rows inserted/updated/deleted
WARNING 01504: 'I25' index not created because it is a duplicate of an existing index: 'I24'.
ij> -- no share
create index i26 on tab2(c1, c3);
0 rows inserted/updated/deleted
ij> insert into tab2 values (6, 2, 8), (2, 8, 5), (28, 5, 9), (3, 12, 543);
4 rows inserted/updated/deleted
ij> create index i27 on tab2 (c1, c2 desc, c3);
0 rows inserted/updated/deleted
ij> -- no share
create index i28 on tab2 (c1, c2 desc, c3 desc);
0 rows inserted/updated/deleted
ij> -- share with i27
create index i29 on tab2 (c1, c2 desc, c3);
0 rows inserted/updated/deleted
WARNING 01504: 'I29' index not created because it is a duplicate of an existing index: 'I27'.
ij> create index i20 on tab2 (c1, c2 desc, c3);
0 rows inserted/updated/deleted
WARNING 01504: 'I20' index not created because it is a duplicate of an existing index: 'I27'.
ij> insert into tab2 values (56, 2, 7), (31, 5, 7), (-12, 5, 2);
3 rows inserted/updated/deleted
ij> select count(distinct conglomeratenumber) from sys.sysconglomerates
	where tableid = (select tableid from sys.systables
						where tablename = 'TAB2');
1          
-----------
7          
ij> select * from tab2;
C1         |C2         |C3         
-----------------------------------
-12        |5          |2          
2          |8          |5          
3          |12         |543        
6          |2          |8          
28         |5          |9          
31         |5          |7          
56         |2          |7          
ij> values SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'TAB2');
1          
-----------
1          
ij> -- see if rebuild indexes correctly
call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'TAB2', 0);
0 rows inserted/updated/deleted
ij> select count(distinct conglomeratenumber) from sys.sysconglomerates
	where tableid = (select tableid from sys.systables
						where tablename = 'TAB2');
1          
-----------
7          
ij> select * from tab2;
C1         |C2         |C3         
-----------------------------------
-12        |5          |2          
2          |8          |5          
3          |12         |543        
6          |2          |8          
28         |5          |9          
31         |5          |7          
56         |2          |7          
ij> update tab2 set c2 = 11 where c3 = 7;
2 rows inserted/updated/deleted
ij> select * from tab2;
C1         |C2         |C3         
-----------------------------------
-12        |5          |2          
2          |8          |5          
3          |12         |543        
6          |2          |8          
28         |5          |9          
31         |11         |7          
56         |11         |7          
ij> delete from tab2 where c2 > 10 and c2 < 12;
2 rows inserted/updated/deleted
ij> select * from tab2;
C1         |C2         |C3         
-----------------------------------
-12        |5          |2          
2          |8          |5          
3          |12         |543        
6          |2          |8          
28         |5          |9          
ij> values SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'TAB2');
1          
-----------
1          
ij> -- drop indexes
drop index i22;
0 rows inserted/updated/deleted
ij> drop index i24;
0 rows inserted/updated/deleted
ij> drop index i26;
0 rows inserted/updated/deleted
ij> drop index i28;
0 rows inserted/updated/deleted
ij> drop index i20;
ERROR 42X65: Index 'I20' does not exist.
ij> select count(distinct conglomeratenumber) from sys.sysconglomerates
	where tableid = (select tableid from sys.systables
						where tablename = 'TAB2');
1          
-----------
3          
ij> call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'TAB2', 0);
0 rows inserted/updated/deleted
ij> select * from tab2;
C1         |C2         |C3         
-----------------------------------
-12        |5          |2          
2          |8          |5          
3          |12         |543        
6          |2          |8          
28         |5          |9          
ij> values SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'TAB2');
1          
-----------
1          
ij> drop index i21;
ERROR 42X65: Index 'I21' does not exist.
ij> drop index i23;
ERROR 42X65: Index 'I23' does not exist.
ij> drop index i25;
ERROR 42X65: Index 'I25' does not exist.
ij> drop index i27;
0 rows inserted/updated/deleted
ij> drop index i29;
ERROR 42X65: Index 'I29' does not exist.
ij> select count(distinct conglomeratenumber) from sys.sysconglomerates
	where tableid = (select tableid from sys.systables
						where tablename = 'TAB2');
1          
-----------
2          
ij> values SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'TAB2');
1          
-----------
1          
ij> -- beetle 4974
create table b4974 (a BIGINT, b BIGINT, c INT, d CHAR(16), e BIGINT);
0 rows inserted/updated/deleted
ij> create index i4974 on b4974(a, d, c, e);
0 rows inserted/updated/deleted
ij> SELECT b from b4974 t1
where (T1.a = 10127 or T1.a = 0)
	and (T1.d = 'ProductBean' or T1.d = 'CatalogEntryBean')
	and (T1.e =0 or T1.e = 0);
B                   
--------------------
ij> rollback;
ij>