You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contrib/pax_storage/src/test/regress/expected/btree_index.out
+74-73Lines changed: 74 additions & 73 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,58 @@
1
1
--
2
2
-- BTREE_INDEX
3
+
--
4
+
-- directory paths are passed to us in environment variables
5
+
\getenv abs_srcdir PG_ABS_SRCDIR
6
+
CREATE TABLE bt_i4_heap (
7
+
seqno int4,
8
+
random int4
9
+
);
10
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'seqno' as the Apache Cloudberry data distribution key for this table.
11
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
12
+
CREATE TABLE bt_name_heap (
13
+
seqno name,
14
+
random int4
15
+
);
16
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'seqno' as the Apache Cloudberry data distribution key for this table.
17
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
18
+
CREATE TABLE bt_txt_heap (
19
+
seqno text,
20
+
random int4
21
+
);
22
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'seqno' as the Apache Cloudberry data distribution key for this table.
23
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
24
+
CREATE TABLE bt_f8_heap (
25
+
seqno float8,
26
+
random int4
27
+
);
28
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'seqno' as the Apache Cloudberry data distribution key for this table.
29
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
30
+
\set filename :abs_srcdir '/data/desc.data'
31
+
COPY bt_i4_heap FROM :'filename';
32
+
\set filename :abs_srcdir '/data/hash.data'
33
+
COPY bt_name_heap FROM :'filename';
34
+
\set filename :abs_srcdir '/data/desc.data'
35
+
COPY bt_txt_heap FROM :'filename';
36
+
\set filename :abs_srcdir '/data/hash.data'
37
+
COPY bt_f8_heap FROM :'filename';
38
+
ANALYZE bt_i4_heap;
39
+
ANALYZE bt_name_heap;
40
+
ANALYZE bt_txt_heap;
41
+
ANALYZE bt_f8_heap;
42
+
--
43
+
-- BTREE ascending/descending cases
44
+
--
45
+
-- we load int4/text from pure descending data (each key is a new
46
+
-- low key) and name/f8 from pure ascending data (each key is a new
47
+
-- high key). we had a bug where new low keys would sometimes be
48
+
-- "lost".
49
+
--
50
+
CREATE INDEX bt_i4_index ON bt_i4_heap USING btree (seqno int4_ops);
51
+
CREATE INDEX bt_name_index ON bt_name_heap USING btree (seqno name_ops);
52
+
CREATE INDEX bt_txt_index ON bt_txt_heap USING btree (seqno text_ops);
53
+
CREATE INDEX bt_f8_index ON bt_f8_heap USING btree (seqno float8_ops);
54
+
--
55
+
-- BTREE_INDEX
3
56
-- test retrieval of min/max keys for each index
4
57
--
5
58
SELECT b.*
@@ -206,7 +259,7 @@ reset enable_sort;
206
259
-- Also check LIKE optimization with binary-compatible cases
207
260
create temp table btree_bpchar (f1 text collate "C");
208
261
create index on btree_bpchar(f1 bpchar_ops) WITH (deduplicate_items=on);
209
-
insert into btree_bpchar values ('foo'), ('foo '), ('fool'), ('bar'), ('quux');
262
+
insert into btree_bpchar values ('foo'), ('fool'), ('bar'), ('quux');
210
263
-- doesn't match index:
211
264
explain (costs off)
212
265
select * from btree_bpchar where f1 like 'foo';
@@ -233,12 +286,11 @@ select * from btree_bpchar where f1 like 'foo%';
233
286
(3 rows)
234
287
235
288
select * from btree_bpchar where f1 like 'foo%';
236
-
f1
237
-
-------
238
-
foo
289
+
f1
290
+
------
239
291
foo
240
292
fool
241
-
(3 rows)
293
+
(2 rows)
242
294
243
295
-- these do match the index:
244
296
explain (costs off)
@@ -267,49 +319,30 @@ select * from btree_bpchar where f1::bpchar like 'foo%';
267
319
Filter: ((f1)::bpchar ~~ 'foo%'::text)
268
320
-> Bitmap Index Scan on btree_bpchar_f1_idx
269
321
Index Cond: (((f1)::bpchar >= 'foo'::bpchar) AND ((f1)::bpchar < 'fop'::bpchar))
270
-
(5 rows)
271
-
272
-
select * from btree_bpchar where f1::bpchar like 'foo%';
273
-
f1
274
-
-------
275
-
foo
276
-
fool
277
-
foo
278
-
(3 rows)
279
-
280
-
explain (costs off)
281
-
select * from btree_bpchar where f1::bpchar ='foo';
0 commit comments