forked from orioledb/orioledb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tableam.out
4171 lines (3985 loc) · 160 KB
/
tableam.out
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
CREATE SCHEMA tableam;
SET SESSION search_path = 'tableam';
CREATE EXTENSION orioledb;
SELECT orioledb_version();
orioledb_version
--------------------------
OrioleDB public alpha 13
(1 row)
SELECT translate(orioledb_commit_hash(), '0123456789abcdef', '################');
translate
------------------------------------------
########################################
(1 row)
CREATE VIEW db_o_tables AS (SELECT c.relname, ot.description
FROM orioledb_table ot JOIN
pg_database db ON db.oid = ot.datoid JOIN
pg_class c ON c.oid = ot.reloid
WHERE db.datname = current_database());
CREATE VIEW db_o_indices AS (SELECT regexp_replace(c.relname, 'pg_toast_\d+', 'pg_toast_NNN') relname, oi.name, oi.description
FROM orioledb_index oi JOIN
pg_database db ON db.oid = oi.datoid JOIN
pg_class c ON c.oid = oi.index_reloid
WHERE db.datname = current_database());
-- index on empty table test
CREATE TABLE o_tableam1
(
key int8 NOT NULL,
value text
) USING orioledb;
-- not supported
CREATE INDEX CONCURRENTLY o_tableam1_ix_concurrently ON o_tableam1 (key);
ERROR: concurrent indexes are not supported.
CREATE INDEX o_tableam1_ix_options ON o_tableam1 (value) WITH (compression = on);
ERROR: unrecognized parameter "compression"
ALTER TABLE o_tableam1 ADD EXCLUDE USING btree (value WITH =);
ERROR: exclusion indices are not supported.
SELECT orioledb_tbl_indices('o_tableam1'::regclass);
orioledb_tbl_indices
------------------------------------------------
Index ctid_primary +
Index type: primary, unique, ctid +
Leaf tuple size: 3, non-leaf tuple size: 1+
Non-leaf tuple fields: ctid +
(1 row)
-- supported
ALTER TABLE o_tableam1 OWNER TO current_user;
CREATE UNIQUE INDEX o_tableam1_ix1 ON o_tableam1 (key);
CREATE INDEX o_tableam1_ix2 on o_tableam1 (value);
SELECT orioledb_tbl_indices('o_tableam1'::regclass);
orioledb_tbl_indices
------------------------------------------------
Index ctid_primary +
Index type: primary, unique, ctid +
Leaf tuple size: 3, non-leaf tuple size: 1+
Non-leaf tuple fields: ctid +
Index o_tableam1_ix1 +
Index type: secondary, unique +
Leaf tuple size: 2, non-leaf tuple size: 2+
Non-leaf tuple fields: key, ctid +
Leaf tuple fields: key, ctid +
Index o_tableam1_ix2 +
Index type: secondary +
Leaf tuple size: 2, non-leaf tuple size: 2+
Non-leaf tuple fields: value, ctid +
Leaf tuple fields: value, ctid +
(1 row)
INSERT INTO o_tableam1 (SELECT id, id || 'text' FROM generate_series(1, 20) as id);
ANALYZE o_tableam1;
EXPLAIN (COSTS off) SELECT * FROM o_tableam1;
QUERY PLAN
------------------------
Seq Scan on o_tableam1
(1 row)
SELECT * FROM o_tableam1;
key | value
-----+--------
1 | 1text
2 | 2text
3 | 3text
4 | 4text
5 | 5text
6 | 6text
7 | 7text
8 | 8text
9 | 9text
10 | 10text
11 | 11text
12 | 12text
13 | 13text
14 | 14text
15 | 15text
16 | 16text
17 | 17text
18 | 18text
19 | 19text
20 | 20text
(20 rows)
SET enable_seqscan = off;
EXPLAIN (COSTS off) SELECT * FROM o_tableam1 WHERE key = 5;
QUERY PLAN
-----------------------------------------
Custom Scan (o_scan) on o_tableam1
Forward index scan of: o_tableam1_ix1
Conds: (key = 5)
(3 rows)
SELECT * FROM o_tableam1 WHERE key = 5;
key | value
-----+-------
5 | 5text
(1 row)
EXPLAIN (COSTS off) SELECT * FROM o_tableam1 ORDER BY key DESC;
QUERY PLAN
------------------------------------------
Custom Scan (o_scan) on o_tableam1
Backward index scan of: o_tableam1_ix1
(2 rows)
SELECT * FROM o_tableam1 ORDER BY key DESC;
key | value
-----+--------
20 | 20text
19 | 19text
18 | 18text
17 | 17text
16 | 16text
15 | 15text
14 | 14text
13 | 13text
12 | 12text
11 | 11text
10 | 10text
9 | 9text
8 | 8text
7 | 7text
6 | 6text
5 | 5text
4 | 4text
3 | 3text
2 | 2text
1 | 1text
(20 rows)
EXPLAIN (COSTS off) SELECT * FROM o_tableam1 WHERE value = '5text';
QUERY PLAN
-----------------------------------------
Custom Scan (o_scan) on o_tableam1
Forward index scan of: o_tableam1_ix2
Conds: (value = '5text'::text)
(3 rows)
SELECT * FROM o_tableam1 WHERE value = '5text';
key | value
-----+-------
5 | 5text
(1 row)
EXPLAIN (COSTS off) SELECT * FROM o_tableam1 WHERE value = '5text' AND key = 5;
QUERY PLAN
-----------------------------------------
Custom Scan (o_scan) on o_tableam1
Filter: (key = 5)
Forward index scan of: o_tableam1_ix2
Conds: (value = '5text'::text)
(4 rows)
SELECT * FROM o_tableam1 WHERE value = '5text' AND key = 5;
key | value
-----+-------
5 | 5text
(1 row)
RESET enable_seqscan;
TRUNCATE o_tableam1;
INSERT INTO o_tableam1 (SELECT id, id || 'text' FROM generate_series(11, 20) as id);
SELECT * FROM o_tableam1;
key | value
-----+--------
11 | 11text
12 | 12text
13 | 13text
14 | 14text
15 | 15text
16 | 16text
17 | 17text
18 | 18text
19 | 19text
20 | 20text
(10 rows)
CREATE TABLE IF NOT EXISTS o_tableam1_like
(LIKE o_tableam1 INCLUDING INDEXES INCLUDING CONSTRAINTS) USING orioledb;
INSERT INTO o_tableam1_like (SELECT id, id || 'text' FROM generate_series(1, 20) as id);
ANALYZE o_tableam1_like;
SELECT * FROM o_tableam1_like;
key | value
-----+--------
1 | 1text
2 | 2text
3 | 3text
4 | 4text
5 | 5text
6 | 6text
7 | 7text
8 | 8text
9 | 9text
10 | 10text
11 | 11text
12 | 12text
13 | 13text
14 | 14text
15 | 15text
16 | 16text
17 | 17text
18 | 18text
19 | 19text
20 | 20text
(20 rows)
DROP TABLE o_tableam1_like;
DROP TABLE o_tableam1;
-- partial index test
CREATE TABLE o_test_partial
(
key int8 NOT NULL PRIMARY KEY,
value text
) USING orioledb;
CREATE FUNCTION plpgsql_func_test(in bigint) RETURNS int AS $$
BEGIN
RETURN ABS($1) * 100;
END;
$$ LANGUAGE plpgsql IMMUTABLE;
CREATE OR REPLACE FUNCTION boolfunc_test(in bigint) RETURNS bool AS $$
BEGIN
RETURN ABS($1) * 100 = 0;
END;
$$ LANGUAGE plpgsql IMMUTABLE;
CREATE INDEX o_test_partial_ix1 ON o_test_partial (key) WHERE key > 10;
CREATE INDEX o_test_partial_ix2 ON o_test_partial (key) WHERE ABS(key) > 10;
CREATE INDEX o_test_partial_ix3 ON o_test_partial (key)
WHERE not ABS(key) = 0;
CREATE INDEX o_test_partial_ix4 ON o_test_partial (key)
WHERE ((not ABS(key) = 0) OR (not ABS(key) = 1));
CREATE INDEX o_test_partial_ix5 ON o_test_partial (key)
WHERE ABS(-ABS(key)) > 10;
CREATE INDEX o_test_partial_ix6 ON o_test_partial (key)
WHERE boolfunc_test(key);
ERROR: function "boolfunc_test" cannot be used here
HINT: only C and SQL functions are supported in orioledb index predicate
CREATE INDEX o_test_partial_ix6 ON o_test_partial (key)
WHERE plpgsql_func_test(key) = 0;
ERROR: function "plpgsql_func_test" cannot be used here
HINT: only C and SQL functions are supported in orioledb index predicate
CREATE INDEX o_test_partial_ix7 ON o_test_partial (key)
WHERE plpgsql_func_test(-key) * 2 = 0;
ERROR: function "plpgsql_func_test" cannot be used here
HINT: only C and SQL functions are supported in orioledb index predicate
CREATE INDEX o_test_partial_ix7 ON o_test_partial (key)
WHERE plpgsql_func_test(-key) * 2 = 0;
ERROR: function "plpgsql_func_test" cannot be used here
HINT: only C and SQL functions are supported in orioledb index predicate
CREATE INDEX o_test_partial_ix7 ON o_test_partial (key)
WHERE COALESCE(NULL, NULL, (plpgsql_func_test(-key) > 0)) != NULL;
ERROR: function "plpgsql_func_test" cannot be used here
HINT: only C and SQL functions are supported in orioledb index predicate
CREATE INDEX o_test_partial_ix7 ON o_test_partial (key)
WHERE GREATEST(NULL, NULL, (ABS(plpgsql_func_test(-key)) > 0)) != NULL;
ERROR: function "plpgsql_func_test" cannot be used here
HINT: only C and SQL functions are supported in orioledb index predicate
CREATE INDEX o_test_partial_ix8 ON o_test_partial (value)
WHERE value > '5';
CREATE INDEX o_test_partial_ix9 ON o_test_partial (value)
WHERE (value || 'WOW') > '5';
SELECT orioledb_tbl_indices('o_test_partial'::regclass);
orioledb_tbl_indices
-----------------------------------------------------
Index o_test_partial_pkey +
Index type: primary, unique +
Leaf tuple size: 2, non-leaf tuple size: 1 +
Non-leaf tuple fields: key +
Index o_test_partial_ix1 +
Index type: secondary +
Predicate: (key > 10) +
Leaf tuple size: 1, non-leaf tuple size: 1 +
Non-leaf tuple fields: key +
Leaf tuple fields: key +
Index o_test_partial_ix2 +
Index type: secondary +
Predicate: (abs(key) > 10) +
Leaf tuple size: 1, non-leaf tuple size: 1 +
Non-leaf tuple fields: key +
Leaf tuple fields: key +
Index o_test_partial_ix3 +
Index type: secondary +
Predicate: (abs(key) <> 0) +
Leaf tuple size: 1, non-leaf tuple size: 1 +
Non-leaf tuple fields: key +
Leaf tuple fields: key +
Index o_test_partial_ix4 +
Index type: secondary +
Predicate: ((abs(key) <> 0) OR (abs(key) <> 1))+
Leaf tuple size: 1, non-leaf tuple size: 1 +
Non-leaf tuple fields: key +
Leaf tuple fields: key +
Index o_test_partial_ix5 +
Index type: secondary +
Predicate: (abs((- abs(key))) > 10) +
Leaf tuple size: 1, non-leaf tuple size: 1 +
Non-leaf tuple fields: key +
Leaf tuple fields: key +
Index o_test_partial_ix8 +
Index type: secondary +
Predicate: (value > '5'::text) +
Leaf tuple size: 2, non-leaf tuple size: 2 +
Non-leaf tuple fields: value, key +
Leaf tuple fields: value, key +
Index o_test_partial_ix9 +
Index type: secondary +
Predicate: ((value || 'WOW'::text) > '5'::text)+
Leaf tuple size: 2, non-leaf tuple size: 2 +
Non-leaf tuple fields: value, key +
Leaf tuple fields: value, key +
(1 row)
INSERT INTO o_test_partial (SELECT id, id || 'text'
FROM generate_series(0, 20) as id);
ANALYZE o_test_partial;
EXPLAIN (COSTS off) SELECT * FROM o_test_partial WHERE key BETWEEN 15 AND 25;
QUERY PLAN
---------------------------------------------
Custom Scan (o_scan) on o_test_partial
Forward index scan of: o_test_partial_ix1
Conds: ((key >= 15) AND (key <= 25))
(3 rows)
SELECT * FROM o_test_partial WHERE key BETWEEN 15 AND 25;
key | value
-----+--------
15 | 15text
16 | 16text
17 | 17text
18 | 18text
19 | 19text
20 | 20text
(6 rows)
EXPLAIN (COSTS off) SELECT key FROM o_test_partial WHERE key BETWEEN 15 AND 25;
QUERY PLAN
--------------------------------------------------
Custom Scan (o_scan) on o_test_partial
Forward index only scan of: o_test_partial_ix1
Conds: ((key >= 15) AND (key <= 25))
(3 rows)
SELECT key FROM o_test_partial WHERE key BETWEEN 15 AND 25;
key
-----
15
16
17
18
19
20
(6 rows)
SET enable_seqscan = OFF;
EXPLAIN (COSTS off) SELECT value FROM o_test_partial
WHERE value BETWEEN '6' AND '9';
QUERY PLAN
----------------------------------------------------------
Custom Scan (o_scan) on o_test_partial
Forward index only scan of: o_test_partial_ix8
Conds: ((value >= '6'::text) AND (value <= '9'::text))
(3 rows)
SELECT value FROM o_test_partial WHERE value BETWEEN '6' AND '9';
value
-------
6text
7text
8text
(3 rows)
EXPLAIN (COSTS off) SELECT value FROM o_test_partial
WHERE (value || 'WOW') BETWEEN '6' AND '9' ORDER BY value;
QUERY PLAN
---------------------------------------------------------------------------------------------
Custom Scan (o_scan) on o_test_partial
Filter: (((value || 'WOW'::text) >= '6'::text) AND ((value || 'WOW'::text) <= '9'::text))
Forward index only scan of: o_test_partial_ix9
(3 rows)
RESET enable_seqscan;
SELECT value FROM o_test_partial
WHERE (value || 'WOW') BETWEEN '6' AND '9';
value
-------
6text
7text
8text
(3 rows)
SELECT orioledb_tbl_structure('o_test_partial'::regclass, 'ne');
orioledb_tbl_structure
---------------------------------------------------------------------------
Index o_test_partial_pkey contents +
Page 0: level = 0, maxKeyLen = 8, nVacatedBytes = 0 +
state = free, datoid equal, relnode equal, ix_type = primary, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64, hikey = ('8')+
Item 0: offset = 272, tuple = ('0', '0text') +
Item 1: offset = 312, tuple = ('1', '1text') +
Item 2: offset = 352, tuple = ('2', '2text') +
Item 3: offset = 392, tuple = ('3', '3text') +
Item 4: offset = 432, tuple = ('4', '4text') +
Item 5: offset = 472, tuple = ('5', '5text') +
Item 6: offset = 512, tuple = ('6', '6text') +
Item 7: offset = 552, tuple = ('7', '7text') +
Chunk 1: offset = 8, location = 592, hikey location = 72 +
Item 8: offset = 624, tuple = ('8', '8text') +
Item 9: offset = 664, tuple = ('9', '9text') +
Item 10: offset = 704, tuple = ('10', '10text') +
Item 11: offset = 744, tuple = ('11', '11text') +
Item 12: offset = 784, tuple = ('12', '12text') +
Item 13: offset = 824, tuple = ('13', '13text') +
Item 14: offset = 864, tuple = ('14', '14text') +
Item 15: offset = 904, tuple = ('15', '15text') +
Item 16: offset = 944, tuple = ('16', '16text') +
Item 17: offset = 984, tuple = ('17', '17text') +
Item 18: offset = 1024, tuple = ('18', '18text') +
Item 19: offset = 1064, tuple = ('19', '19text') +
Item 20: offset = 1104, tuple = ('20', '20text') +
+
Index o_test_partial_ix1 contents +
Page 0: level = 0, maxKeyLen = 8, nVacatedBytes = 0 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64 +
Item 0: offset = 280, tuple = ('11') +
Item 1: offset = 304, tuple = ('12') +
Item 2: offset = 328, tuple = ('13') +
Item 3: offset = 352, tuple = ('14') +
Item 4: offset = 376, tuple = ('15') +
Item 5: offset = 400, tuple = ('16') +
Item 6: offset = 424, tuple = ('17') +
Item 7: offset = 448, tuple = ('18') +
Item 8: offset = 472, tuple = ('19') +
Item 9: offset = 496, tuple = ('20') +
+
Index o_test_partial_ix2 contents +
Page 0: level = 0, maxKeyLen = 8, nVacatedBytes = 0 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64 +
Item 0: offset = 280, tuple = ('11') +
Item 1: offset = 304, tuple = ('12') +
Item 2: offset = 328, tuple = ('13') +
Item 3: offset = 352, tuple = ('14') +
Item 4: offset = 376, tuple = ('15') +
Item 5: offset = 400, tuple = ('16') +
Item 6: offset = 424, tuple = ('17') +
Item 7: offset = 448, tuple = ('18') +
Item 8: offset = 472, tuple = ('19') +
Item 9: offset = 496, tuple = ('20') +
+
Index o_test_partial_ix3 contents +
Page 0: level = 0, maxKeyLen = 8, nVacatedBytes = 0 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64 +
Item 0: offset = 296, tuple = ('1') +
Item 1: offset = 320, tuple = ('2') +
Item 2: offset = 344, tuple = ('3') +
Item 3: offset = 368, tuple = ('4') +
Item 4: offset = 392, tuple = ('5') +
Item 5: offset = 416, tuple = ('6') +
Item 6: offset = 440, tuple = ('7') +
Item 7: offset = 464, tuple = ('8') +
Item 8: offset = 488, tuple = ('9') +
Item 9: offset = 512, tuple = ('10') +
Item 10: offset = 536, tuple = ('11') +
Item 11: offset = 560, tuple = ('12') +
Item 12: offset = 584, tuple = ('13') +
Item 13: offset = 608, tuple = ('14') +
Item 14: offset = 632, tuple = ('15') +
Item 15: offset = 656, tuple = ('16') +
Item 16: offset = 680, tuple = ('17') +
Item 17: offset = 704, tuple = ('18') +
Item 18: offset = 728, tuple = ('19') +
Item 19: offset = 752, tuple = ('20') +
+
Index o_test_partial_ix4 contents +
Page 0: level = 0, maxKeyLen = 8, nVacatedBytes = 0 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64 +
Item 0: offset = 304, tuple = ('0') +
Item 1: offset = 328, tuple = ('1') +
Item 2: offset = 352, tuple = ('2') +
Item 3: offset = 376, tuple = ('3') +
Item 4: offset = 400, tuple = ('4') +
Item 5: offset = 424, tuple = ('5') +
Item 6: offset = 448, tuple = ('6') +
Item 7: offset = 472, tuple = ('7') +
Item 8: offset = 496, tuple = ('8') +
Item 9: offset = 520, tuple = ('9') +
Item 10: offset = 544, tuple = ('10') +
Item 11: offset = 568, tuple = ('11') +
Item 12: offset = 592, tuple = ('12') +
Item 13: offset = 616, tuple = ('13') +
Item 14: offset = 640, tuple = ('14') +
Item 15: offset = 664, tuple = ('15') +
Item 16: offset = 688, tuple = ('16') +
Item 17: offset = 712, tuple = ('17') +
Item 18: offset = 736, tuple = ('18') +
Item 19: offset = 760, tuple = ('19') +
Item 20: offset = 784, tuple = ('20') +
+
Index o_test_partial_ix5 contents +
Page 0: level = 0, maxKeyLen = 8, nVacatedBytes = 0 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64 +
Item 0: offset = 280, tuple = ('11') +
Item 1: offset = 304, tuple = ('12') +
Item 2: offset = 328, tuple = ('13') +
Item 3: offset = 352, tuple = ('14') +
Item 4: offset = 376, tuple = ('15') +
Item 5: offset = 400, tuple = ('16') +
Item 6: offset = 424, tuple = ('17') +
Item 7: offset = 448, tuple = ('18') +
Item 8: offset = 472, tuple = ('19') +
Item 9: offset = 496, tuple = ('20') +
+
Index o_test_partial_ix8 contents +
Page 0: level = 0, maxKeyLen = 24, nVacatedBytes = 0 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64 +
Item 0: offset = 272, tuple = ('5text', '5') +
Item 1: offset = 312, tuple = ('6text', '6') +
Item 2: offset = 352, tuple = ('7text', '7') +
Item 3: offset = 392, tuple = ('8text', '8') +
Item 4: offset = 432, tuple = ('9text', '9') +
+
Index o_test_partial_ix9 contents +
Page 0: level = 0, maxKeyLen = 24, nVacatedBytes = 0 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64 +
Item 0: offset = 272, tuple = ('5text', '5') +
Item 1: offset = 312, tuple = ('6text', '6') +
Item 2: offset = 352, tuple = ('7text', '7') +
Item 3: offset = 392, tuple = ('8text', '8') +
Item 4: offset = 432, tuple = ('9text', '9') +
+
Index toast: not loaded +
(1 row)
DELETE FROM o_test_partial WHERE key = 1;
UPDATE o_test_partial SET key = key + 100 WHERE key BETWEEN 5 AND 15;
SELECT orioledb_tbl_structure('o_test_partial'::regclass, 'ne');
orioledb_tbl_structure
------------------------------------------------------------------------------
Index o_test_partial_pkey contents +
Page 0: level = 0, maxKeyLen = 8, nVacatedBytes = 480 +
state = free, datoid equal, relnode equal, ix_type = primary, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 72, hikey = ('8') +
Item 0: offset = 272, tuple = ('0', '0text') +
Item 1: deleted, offset = 312, tuple = ('1', '1text') +
Item 2: offset = 352, tuple = ('2', '2text') +
Item 3: offset = 392, tuple = ('3', '3text') +
Item 4: offset = 432, tuple = ('4', '4text') +
Item 5: PK changed, offset = 472, tuple = ('5', '5text') +
Item 6: PK changed, offset = 512, tuple = ('6', '6text') +
Item 7: PK changed, offset = 552, tuple = ('7', '7text') +
Chunk 1: offset = 8, location = 592, hikey location = 80, hikey = ('16') +
Item 8: PK changed, offset = 608, tuple = ('8', '8text') +
Item 9: PK changed, offset = 648, tuple = ('9', '9text') +
Item 10: PK changed, offset = 688, tuple = ('10', '10text') +
Item 11: PK changed, offset = 728, tuple = ('11', '11text') +
Item 12: PK changed, offset = 768, tuple = ('12', '12text') +
Item 13: PK changed, offset = 808, tuple = ('13', '13text') +
Item 14: PK changed, offset = 848, tuple = ('14', '14text') +
Item 15: PK changed, offset = 888, tuple = ('15', '15text') +
Chunk 2: offset = 16, location = 928, hikey location = 88, hikey = ('108')+
Item 16: offset = 944, tuple = ('16', '16text') +
Item 17: offset = 984, tuple = ('17', '17text') +
Item 18: offset = 1024, tuple = ('18', '18text') +
Item 19: offset = 1064, tuple = ('19', '19text') +
Item 20: offset = 1104, tuple = ('20', '20text') +
Item 21: offset = 1144, tuple = ('105', '5text') +
Item 22: offset = 1184, tuple = ('106', '6text') +
Item 23: offset = 1224, tuple = ('107', '7text') +
Chunk 3: offset = 24, location = 1264, hikey location = 96 +
Item 24: offset = 1280, tuple = ('108', '8text') +
Item 25: offset = 1320, tuple = ('109', '9text') +
Item 26: offset = 1360, tuple = ('110', '10text') +
Item 27: offset = 1400, tuple = ('111', '11text') +
Item 28: offset = 1440, tuple = ('112', '12text') +
Item 29: offset = 1480, tuple = ('113', '13text') +
Item 30: offset = 1520, tuple = ('114', '14text') +
Item 31: offset = 1560, tuple = ('115', '15text') +
+
Index o_test_partial_ix1 contents +
Page 0: level = 0, maxKeyLen = 8, nVacatedBytes = 120 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64 +
Item 0: deleted, offset = 304, tuple = ('11') +
Item 1: deleted, offset = 328, tuple = ('12') +
Item 2: deleted, offset = 352, tuple = ('13') +
Item 3: deleted, offset = 376, tuple = ('14') +
Item 4: deleted, offset = 400, tuple = ('15') +
Item 5: offset = 424, tuple = ('16') +
Item 6: offset = 448, tuple = ('17') +
Item 7: offset = 472, tuple = ('18') +
Item 8: offset = 496, tuple = ('19') +
Item 9: offset = 520, tuple = ('20') +
Item 10: offset = 544, tuple = ('105') +
Item 11: offset = 568, tuple = ('106') +
Item 12: offset = 592, tuple = ('107') +
Item 13: offset = 616, tuple = ('108') +
Item 14: offset = 640, tuple = ('109') +
Item 15: offset = 664, tuple = ('110') +
Item 16: offset = 688, tuple = ('111') +
Item 17: offset = 712, tuple = ('112') +
Item 18: offset = 736, tuple = ('113') +
Item 19: offset = 760, tuple = ('114') +
Item 20: offset = 784, tuple = ('115') +
+
Index o_test_partial_ix2 contents +
Page 0: level = 0, maxKeyLen = 8, nVacatedBytes = 120 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64 +
Item 0: deleted, offset = 304, tuple = ('11') +
Item 1: deleted, offset = 328, tuple = ('12') +
Item 2: deleted, offset = 352, tuple = ('13') +
Item 3: deleted, offset = 376, tuple = ('14') +
Item 4: deleted, offset = 400, tuple = ('15') +
Item 5: offset = 424, tuple = ('16') +
Item 6: offset = 448, tuple = ('17') +
Item 7: offset = 472, tuple = ('18') +
Item 8: offset = 496, tuple = ('19') +
Item 9: offset = 520, tuple = ('20') +
Item 10: offset = 544, tuple = ('105') +
Item 11: offset = 568, tuple = ('106') +
Item 12: offset = 592, tuple = ('107') +
Item 13: offset = 616, tuple = ('108') +
Item 14: offset = 640, tuple = ('109') +
Item 15: offset = 664, tuple = ('110') +
Item 16: offset = 688, tuple = ('111') +
Item 17: offset = 712, tuple = ('112') +
Item 18: offset = 736, tuple = ('113') +
Item 19: offset = 760, tuple = ('114') +
Item 20: offset = 784, tuple = ('115') +
+
Index o_test_partial_ix3 contents +
Page 0: level = 0, maxKeyLen = 8, nVacatedBytes = 288 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64, hikey = ('13') +
Item 0: deleted, offset = 280, tuple = ('1') +
Item 1: offset = 304, tuple = ('2') +
Item 2: offset = 328, tuple = ('3') +
Item 3: offset = 352, tuple = ('4') +
Item 4: deleted, offset = 376, tuple = ('5') +
Item 5: deleted, offset = 400, tuple = ('6') +
Item 6: deleted, offset = 424, tuple = ('7') +
Item 7: deleted, offset = 448, tuple = ('8') +
Item 8: deleted, offset = 472, tuple = ('9') +
Item 9: deleted, offset = 496, tuple = ('10') +
Item 10: deleted, offset = 520, tuple = ('11') +
Item 11: deleted, offset = 544, tuple = ('12') +
Chunk 1: offset = 12, location = 568, hikey location = 72 +
Item 12: deleted, offset = 608, tuple = ('13') +
Item 13: deleted, offset = 632, tuple = ('14') +
Item 14: deleted, offset = 656, tuple = ('15') +
Item 15: offset = 680, tuple = ('16') +
Item 16: offset = 704, tuple = ('17') +
Item 17: offset = 728, tuple = ('18') +
Item 18: offset = 752, tuple = ('19') +
Item 19: offset = 776, tuple = ('20') +
Item 20: offset = 800, tuple = ('105') +
Item 21: offset = 824, tuple = ('106') +
Item 22: offset = 848, tuple = ('107') +
Item 23: offset = 872, tuple = ('108') +
Item 24: offset = 896, tuple = ('109') +
Item 25: offset = 920, tuple = ('110') +
Item 26: offset = 944, tuple = ('111') +
Item 27: offset = 968, tuple = ('112') +
Item 28: offset = 992, tuple = ('113') +
Item 29: offset = 1016, tuple = ('114') +
Item 30: offset = 1040, tuple = ('115') +
+
Index o_test_partial_ix4 contents +
Page 0: level = 0, maxKeyLen = 8, nVacatedBytes = 288 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64, hikey = ('12') +
Item 0: offset = 280, tuple = ('0') +
Item 1: deleted, offset = 304, tuple = ('1') +
Item 2: offset = 328, tuple = ('2') +
Item 3: offset = 352, tuple = ('3') +
Item 4: offset = 376, tuple = ('4') +
Item 5: deleted, offset = 400, tuple = ('5') +
Item 6: deleted, offset = 424, tuple = ('6') +
Item 7: deleted, offset = 448, tuple = ('7') +
Item 8: deleted, offset = 472, tuple = ('8') +
Item 9: deleted, offset = 496, tuple = ('9') +
Item 10: deleted, offset = 520, tuple = ('10') +
Item 11: deleted, offset = 544, tuple = ('11') +
Chunk 1: offset = 12, location = 568, hikey location = 72 +
Item 12: deleted, offset = 608, tuple = ('12') +
Item 13: deleted, offset = 632, tuple = ('13') +
Item 14: deleted, offset = 656, tuple = ('14') +
Item 15: deleted, offset = 680, tuple = ('15') +
Item 16: offset = 704, tuple = ('16') +
Item 17: offset = 728, tuple = ('17') +
Item 18: offset = 752, tuple = ('18') +
Item 19: offset = 776, tuple = ('19') +
Item 20: offset = 800, tuple = ('20') +
Item 21: offset = 824, tuple = ('105') +
Item 22: offset = 848, tuple = ('106') +
Item 23: offset = 872, tuple = ('107') +
Item 24: offset = 896, tuple = ('108') +
Item 25: offset = 920, tuple = ('109') +
Item 26: offset = 944, tuple = ('110') +
Item 27: offset = 968, tuple = ('111') +
Item 28: offset = 992, tuple = ('112') +
Item 29: offset = 1016, tuple = ('113') +
Item 30: offset = 1040, tuple = ('114') +
Item 31: offset = 1064, tuple = ('115') +
+
Index o_test_partial_ix5 contents +
Page 0: level = 0, maxKeyLen = 8, nVacatedBytes = 120 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64 +
Item 0: deleted, offset = 304, tuple = ('11') +
Item 1: deleted, offset = 328, tuple = ('12') +
Item 2: deleted, offset = 352, tuple = ('13') +
Item 3: deleted, offset = 376, tuple = ('14') +
Item 4: deleted, offset = 400, tuple = ('15') +
Item 5: offset = 424, tuple = ('16') +
Item 6: offset = 448, tuple = ('17') +
Item 7: offset = 472, tuple = ('18') +
Item 8: offset = 496, tuple = ('19') +
Item 9: offset = 520, tuple = ('20') +
Item 10: offset = 544, tuple = ('105') +
Item 11: offset = 568, tuple = ('106') +
Item 12: offset = 592, tuple = ('107') +
Item 13: offset = 616, tuple = ('108') +
Item 14: offset = 640, tuple = ('109') +
Item 15: offset = 664, tuple = ('110') +
Item 16: offset = 688, tuple = ('111') +
Item 17: offset = 712, tuple = ('112') +
Item 18: offset = 736, tuple = ('113') +
Item 19: offset = 760, tuple = ('114') +
Item 20: offset = 784, tuple = ('115') +
+
Index o_test_partial_ix8 contents +
Page 0: level = 0, maxKeyLen = 24, nVacatedBytes = 200 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64 +
Item 0: deleted, offset = 280, tuple = ('5text', '5') +
Item 1: offset = 320, tuple = ('5text', '105') +
Item 2: deleted, offset = 360, tuple = ('6text', '6') +
Item 3: offset = 400, tuple = ('6text', '106') +
Item 4: deleted, offset = 440, tuple = ('7text', '7') +
Item 5: offset = 480, tuple = ('7text', '107') +
Item 6: deleted, offset = 520, tuple = ('8text', '8') +
Item 7: offset = 560, tuple = ('8text', '108') +
Item 8: deleted, offset = 600, tuple = ('9text', '9') +
Item 9: offset = 640, tuple = ('9text', '109') +
+
Index o_test_partial_ix9 contents +
Page 0: level = 0, maxKeyLen = 24, nVacatedBytes = 200 +
state = free, datoid equal, relnode equal, ix_type = regular, dirty +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 64 +
Item 0: deleted, offset = 280, tuple = ('5text', '5') +
Item 1: offset = 320, tuple = ('5text', '105') +
Item 2: deleted, offset = 360, tuple = ('6text', '6') +
Item 3: offset = 400, tuple = ('6text', '106') +
Item 4: deleted, offset = 440, tuple = ('7text', '7') +
Item 5: offset = 480, tuple = ('7text', '107') +
Item 6: deleted, offset = 520, tuple = ('8text', '8') +
Item 7: offset = 560, tuple = ('8text', '108') +
Item 8: deleted, offset = 600, tuple = ('9text', '9') +
Item 9: offset = 640, tuple = ('9text', '109') +
+
Index toast: not loaded +
(1 row)
SET enable_seqscan = OFF;
ALTER TABLE o_test_partial DROP CONSTRAINT o_test_partial_pkey;
EXPLAIN (COSTS off) SELECT * FROM o_test_partial WHERE key > 15;
QUERY PLAN
---------------------------------------------
Custom Scan (o_scan) on o_test_partial
Forward index scan of: o_test_partial_ix1
Conds: (key > 15)
(3 rows)
SELECT * FROM o_test_partial WHERE key > 15;
key | value
-----+--------
16 | 16text
17 | 17text
18 | 18text
19 | 19text
20 | 20text
105 | 5text
106 | 6text
107 | 7text
108 | 8text
109 | 9text
110 | 10text
111 | 11text
112 | 12text
113 | 13text
114 | 14text
115 | 15text
(16 rows)
RESET enable_seqscan;
SELECT orioledb_tbl_structure('o_test_partial'::regclass, 'ne');
orioledb_tbl_structure
-----------------------------------------------------------------------------------------
Index ctid_primary contents +
Page 0: level = 0, maxKeyLen = 6, nVacatedBytes = 0 +
state = free, datoid equal, relnode equal, ix_type = primary, clean +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 96, hikey = ('(0,2)') +
Item 0: offset = 264, tuple = ('(0,0)', '0', '0text') +
Item 1: offset = 312, tuple = ('(0,1)', '2', '2text') +
Chunk 1: offset = 2, location = 360, hikey location = 104, hikey = ('(0,4)') +
Item 2: offset = 368, tuple = ('(0,2)', '3', '3text') +
Item 3: offset = 416, tuple = ('(0,3)', '4', '4text') +
Chunk 2: offset = 4, location = 464, hikey location = 112, hikey = ('(0,6)') +
Item 4: offset = 472, tuple = ('(0,4)', '16', '16text') +
Item 5: offset = 520, tuple = ('(0,5)', '17', '17text') +
Chunk 3: offset = 6, location = 568, hikey location = 120, hikey = ('(0,8)') +
Item 6: offset = 576, tuple = ('(0,6)', '18', '18text') +
Item 7: offset = 624, tuple = ('(0,7)', '19', '19text') +
Chunk 4: offset = 8, location = 672, hikey location = 128, hikey = ('(0,10)') +
Item 8: offset = 680, tuple = ('(0,8)', '20', '20text') +
Item 9: offset = 728, tuple = ('(0,9)', '105', '5text') +
Chunk 5: offset = 10, location = 776, hikey location = 136, hikey = ('(0,12)') +
Item 10: offset = 784, tuple = ('(0,10)', '106', '6text') +
Item 11: offset = 832, tuple = ('(0,11)', '107', '7text') +
Chunk 6: offset = 12, location = 880, hikey location = 144, hikey = ('(0,14)') +
Item 12: offset = 888, tuple = ('(0,12)', '108', '8text') +
Item 13: offset = 936, tuple = ('(0,13)', '109', '9text') +
Chunk 7: offset = 14, location = 984, hikey location = 152, hikey = ('(0,16)') +
Item 14: offset = 992, tuple = ('(0,14)', '110', '10text') +
Item 15: offset = 1040, tuple = ('(0,15)', '111', '11text') +
Chunk 8: offset = 16, location = 1088, hikey location = 160, hikey = ('(0,18)') +
Item 16: offset = 1096, tuple = ('(0,16)', '112', '12text') +
Item 17: offset = 1144, tuple = ('(0,17)', '113', '13text') +
Chunk 9: offset = 18, location = 1192, hikey location = 168 +
Item 18: offset = 1200, tuple = ('(0,18)', '114', '14text') +
Item 19: offset = 1248, tuple = ('(0,19)', '115', '15text') +
+
Index o_test_partial_ix1 contents +
Page 0: level = 0, maxKeyLen = 14, nVacatedBytes = 0 +
state = free, datoid equal, relnode equal, ix_type = regular, clean +
Leftmost, Rightmost +
Chunk 0: offset = 0, location = 256, hikey location = 88, hikey = ('18', '(0,6)') +
Item 0: offset = 264, tuple = ('16', '(0,4)') +
Item 1: offset = 296, tuple = ('17', '(0,5)') +
Chunk 1: offset = 2, location = 328, hikey location = 104, hikey = ('20', '(0,8)') +
Item 2: offset = 336, tuple = ('18', '(0,6)') +
Item 3: offset = 368, tuple = ('19', '(0,7)') +
Chunk 2: offset = 4, location = 400, hikey location = 120, hikey = ('106', '(0,10)') +
Item 4: offset = 408, tuple = ('20', '(0,8)') +
Item 5: offset = 440, tuple = ('105', '(0,9)') +
Chunk 3: offset = 6, location = 472, hikey location = 136, hikey = ('108', '(0,12)') +
Item 6: offset = 480, tuple = ('106', '(0,10)') +
Item 7: offset = 512, tuple = ('107', '(0,11)') +
Chunk 4: offset = 8, location = 544, hikey location = 152, hikey = ('110', '(0,14)') +
Item 8: offset = 552, tuple = ('108', '(0,12)') +
Item 9: offset = 584, tuple = ('109', '(0,13)') +
Chunk 5: offset = 10, location = 616, hikey location = 168, hikey = ('112', '(0,16)')+
Item 10: offset = 624, tuple = ('110', '(0,14)') +
Item 11: offset = 656, tuple = ('111', '(0,15)') +
Chunk 6: offset = 12, location = 688, hikey location = 184, hikey = ('114', '(0,18)')+
Item 12: offset = 696, tuple = ('112', '(0,16)') +
Item 13: offset = 728, tuple = ('113', '(0,17)') +
Chunk 7: offset = 14, location = 760, hikey location = 200 +
Item 14: offset = 768, tuple = ('114', '(0,18)') +
Item 15: offset = 800, tuple = ('115', '(0,19)') +
+
Index o_test_partial_ix2: not loaded +
Index o_test_partial_ix3: not loaded +
Index o_test_partial_ix4: not loaded +
Index o_test_partial_ix5: not loaded +
Index o_test_partial_ix8: not loaded +
Index o_test_partial_ix9: not loaded +
Index toast: not loaded +
(1 row)
DROP TABLE o_test_partial;
-- expression index test
CREATE TABLE o_test_expression
(
key int8 NOT NULL PRIMARY KEY,
value text
) USING orioledb;
CREATE INDEX o_test_expression_ix1 ON o_test_expression ((key * 100));
CREATE INDEX o_test_expression_ix2 ON o_test_expression (key, (key * 100));
CREATE INDEX o_test_expression_ix3 ON o_test_expression ((value || 'WOW'));
CREATE INDEX o_test_expression_ix4
ON o_test_expression (value, (value || 'WOW'));
CREATE INDEX o_test_expression_ix5
ON o_test_expression ((key * 1000), value, key, (value || 'WOW2'), key);
CREATE INDEX o_test_expression_ix6 ON o_test_expression (UPPER(value), key,
LOWER(value));
CREATE INDEX o_test_expression_ix7
ON o_test_expression ((TRUE), key,
((not ABS(key) = 0) OR (not ABS(key) = 1)));
CREATE INDEX o_test_expression_ix8
ON o_test_expression (boolfunc_test(key));
ERROR: function "boolfunc_test" cannot be used here
HINT: only C and SQL functions are supported in orioledb index expressions
SELECT orioledb_tbl_indices('o_test_expression'::regclass);
orioledb_tbl_indices
------------------------------------------------------------------------------
Index o_test_expression_pkey +
Index type: primary, unique +
Leaf tuple size: 2, non-leaf tuple size: 1 +
Non-leaf tuple fields: key +
Index o_test_expression_ix1 +
Index type: secondary +
Leaf tuple size: 2, non-leaf tuple size: 2 +
Non-leaf tuple fields: (key * 100), key +
Leaf tuple fields: (key * 100), key +
Index o_test_expression_ix2 +
Index type: secondary +
Leaf tuple size: 2, non-leaf tuple size: 2 +
Non-leaf tuple fields: key, (key * 100) +
Leaf tuple fields: key, (key * 100) +
Index o_test_expression_ix3 +
Index type: secondary +
Leaf tuple size: 2, non-leaf tuple size: 2 +
Non-leaf tuple fields: (value || 'WOW'::text), key +
Leaf tuple fields: (value || 'WOW'::text), key +
Index o_test_expression_ix4 +
Index type: secondary +
Leaf tuple size: 3, non-leaf tuple size: 3 +
Non-leaf tuple fields: value, (value || 'WOW'::text), key +
Leaf tuple fields: value, (value || 'WOW'::text), key +
Index o_test_expression_ix5 +
Index type: secondary +
Leaf tuple size: 4, non-leaf tuple size: 4 +
Non-leaf tuple fields: (key * 1000), value, key, (value || 'WOW2'::text)+
Leaf tuple fields: (key * 1000), value, key, (value || 'WOW2'::text) +
Index o_test_expression_ix6 +
Index type: secondary +
Leaf tuple size: 3, non-leaf tuple size: 3 +
Non-leaf tuple fields: upper(value), key, lower(value) +
Leaf tuple fields: upper(value), key, lower(value) +
Index o_test_expression_ix7 +
Index type: secondary +
Leaf tuple size: 3, non-leaf tuple size: 3 +
Non-leaf tuple fields: true, key, ((abs(key) <> 0) OR (abs(key) <> 1)) +
Leaf tuple fields: true, key, ((abs(key) <> 0) OR (abs(key) <> 1)) +
(1 row)
INSERT INTO o_test_expression (SELECT id, id || 'text'
FROM generate_series(0, 20) as id);
ANALYZE o_test_expression;
CREATE OR REPLACE FUNCTION smart_explain(sql TEXT) RETURNS SETOF TEXT AS $$
DECLARE
row RECORD;
line text;
indent integer;
skip_indent integer;
skip_start integer;
BEGIN
skip_indent := 0;
skip_start := 0;