Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6ed9d49

Browse files
committed
initial btree emulation in rum
1 parenta1da826 commit6ed9d49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2649
-314
lines changed

‎Makefile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@ OBJS = src/rumsort.o src/rum_ts_utils.o src/rumtsquery.o \
55
src/rumbtree.o src/rumbulk.o src/rumdatapage.o\
66
src/rumentrypage.o src/rumget.o src/ruminsert.o\
77
src/rumscan.o src/rumutil.o src/rumvacuum.o src/rumvalidate.o\
8-
src/rum_timestamp.o$(WIN32RES)
8+
src/btree_rum.o$(WIN32RES)
99

1010
EXTENSION = rum
11-
DATA = rum--1.0.sql
11+
DATA = rum--1.0.sql rum--1.0--1.1.sql rum--1.1.sql
1212
PGFILEDESC = "RUM index access method"
1313
INCLUDES = src/rum.h src/rumsort.h
1414

1515
REGRESS = rum rum_hash ruminv timestamp orderby orderby_hash altorder\
16-
altorder_hash limits
16+
altorder_hash limits\
17+
int2 int4 int8 float4 float8 money oid\
18+
time timetz date interval\
19+
macaddr inet cidr text varchar char bytea bit varbit\
20+
numeric
21+
22+
EXTRA_CLEAN += rum--1.1.sql
1723

1824
LDFLAGS_SL +=$(filter -lm,$(LIBS))
1925

@@ -31,6 +37,13 @@ endif
3137
wal-check: temp-install
3238
$(prove_check)
3339

40+
all: rum--1.1.sql
41+
42+
#9.6 requires 1.1 file but 10.0 could live with 1.0 + 1.0-1.1 files
43+
rum--1.1.sql: rum--1.0.sql rum--1.0--1.1.sql
44+
cat rum--1.0.sql rum--1.0--1.1.sql> rum--1.1.sql
45+
46+
3447
install: installincludes
3548

3649
installincludes:

‎TODO

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
4. Compression addInfo
55
5. Remove FROM_STRATEGY ugly magick
66

7+
8+
BTREE:
9+
1 fix changes in rum--1.0.sql
10+
2 adding using as addinfo

‎expected/bit.out

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
set enable_seqscan=off;
2+
CREATE TABLE test_bit (
3+
i bit(3)
4+
);
5+
INSERT INTO test_bit VALUES ('001'),('010'),('011'),('100'),('101'),('110');
6+
CREATE INDEX idx_bit ON test_bit USING rum (i);
7+
SELECT * FROM test_bit WHERE i<'100'::bit(3) ORDER BY i;
8+
i
9+
-----
10+
001
11+
010
12+
011
13+
(3 rows)
14+
15+
SELECT * FROM test_bit WHERE i<='100'::bit(3) ORDER BY i;
16+
i
17+
-----
18+
001
19+
010
20+
011
21+
100
22+
(4 rows)
23+
24+
SELECT * FROM test_bit WHERE i='100'::bit(3) ORDER BY i;
25+
i
26+
-----
27+
100
28+
(1 row)
29+
30+
SELECT * FROM test_bit WHERE i>='100'::bit(3) ORDER BY i;
31+
i
32+
-----
33+
100
34+
101
35+
110
36+
(3 rows)
37+
38+
SELECT * FROM test_bit WHERE i>'100'::bit(3) ORDER BY i;
39+
i
40+
-----
41+
101
42+
110
43+
(2 rows)
44+

‎expected/bytea.out

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
set enable_seqscan=off;
2+
-- ensure consistent test output regardless of the default bytea format
3+
SET bytea_output TO escape;
4+
CREATE TABLE test_bytea (
5+
i bytea
6+
);
7+
INSERT INTO test_bytea VALUES ('a'),('ab'),('abc'),('abb'),('axy'),('xyz');
8+
CREATE INDEX idx_bytea ON test_bytea USING rum (i);
9+
SELECT * FROM test_bytea WHERE i<'abc'::bytea ORDER BY i;
10+
i
11+
-----
12+
a
13+
ab
14+
abb
15+
(3 rows)
16+
17+
SELECT * FROM test_bytea WHERE i<='abc'::bytea ORDER BY i;
18+
i
19+
-----
20+
a
21+
ab
22+
abb
23+
abc
24+
(4 rows)
25+
26+
SELECT * FROM test_bytea WHERE i='abc'::bytea ORDER BY i;
27+
i
28+
-----
29+
abc
30+
(1 row)
31+
32+
SELECT * FROM test_bytea WHERE i>='abc'::bytea ORDER BY i;
33+
i
34+
-----
35+
abc
36+
axy
37+
xyz
38+
(3 rows)
39+
40+
SELECT * FROM test_bytea WHERE i>'abc'::bytea ORDER BY i;
41+
i
42+
-----
43+
axy
44+
xyz
45+
(2 rows)
46+

‎expected/char.out

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
set enable_seqscan=off;
2+
CREATE TABLE test_char (
3+
i "char"
4+
);
5+
INSERT INTO test_char VALUES ('a'),('b'),('c'),('d'),('e'),('f');
6+
CREATE INDEX idx_char ON test_char USING rum (i);
7+
SELECT * FROM test_char WHERE i<'d'::"char" ORDER BY i;
8+
i
9+
---
10+
(0 rows)
11+
12+
SELECT * FROM test_char WHERE i<='d'::"char" ORDER BY i;
13+
i
14+
---
15+
(0 rows)
16+
17+
SELECT * FROM test_char WHERE i='d'::"char" ORDER BY i;
18+
i
19+
---
20+
d
21+
(1 row)
22+
23+
SELECT * FROM test_char WHERE i>='d'::"char" ORDER BY i;
24+
i
25+
---
26+
d
27+
e
28+
f
29+
(3 rows)
30+
31+
SELECT * FROM test_char WHERE i>'d'::"char" ORDER BY i;
32+
i
33+
---
34+
e
35+
f
36+
(2 rows)
37+

‎expected/cidr.out

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
set enable_seqscan=off;
2+
CREATE TABLE test_cidr (
3+
i cidr
4+
);
5+
INSERT INTO test_cidr VALUES
6+
( '1.2.3.4' ),
7+
( '1.2.4.4' ),
8+
( '1.2.5.4' ),
9+
( '1.2.6.4' ),
10+
( '1.2.7.4' ),
11+
( '1.2.8.4' )
12+
;
13+
CREATE INDEX idx_cidr ON test_cidr USING rum (i);
14+
SELECT * FROM test_cidr WHERE i<'1.2.6.4'::cidr ORDER BY i;
15+
i
16+
------------
17+
1.2.3.4/32
18+
1.2.4.4/32
19+
1.2.5.4/32
20+
(3 rows)
21+
22+
SELECT * FROM test_cidr WHERE i<='1.2.6.4'::cidr ORDER BY i;
23+
i
24+
------------
25+
1.2.3.4/32
26+
1.2.4.4/32
27+
1.2.5.4/32
28+
1.2.6.4/32
29+
(4 rows)
30+
31+
SELECT * FROM test_cidr WHERE i='1.2.6.4'::cidr ORDER BY i;
32+
i
33+
------------
34+
1.2.6.4/32
35+
(1 row)
36+
37+
SELECT * FROM test_cidr WHERE i>='1.2.6.4'::cidr ORDER BY i;
38+
i
39+
------------
40+
1.2.6.4/32
41+
1.2.7.4/32
42+
1.2.8.4/32
43+
(3 rows)
44+
45+
SELECT * FROM test_cidr WHERE i>'1.2.6.4'::cidr ORDER BY i;
46+
i
47+
------------
48+
1.2.7.4/32
49+
1.2.8.4/32
50+
(2 rows)
51+

‎expected/date.out

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
set enable_seqscan=off;
2+
CREATE TABLE test_date (
3+
i date
4+
);
5+
INSERT INTO test_date VALUES
6+
( '2004-10-23' ),
7+
( '2004-10-24' ),
8+
( '2004-10-25' ),
9+
( '2004-10-26' ),
10+
( '2004-10-27' ),
11+
( '2004-10-28' )
12+
;
13+
CREATE INDEX idx_date ON test_date USING rum (i);
14+
SELECT * FROM test_date WHERE i<'2004-10-26'::date ORDER BY i;
15+
i
16+
------------
17+
10-23-2004
18+
10-24-2004
19+
10-25-2004
20+
(3 rows)
21+
22+
SELECT * FROM test_date WHERE i<='2004-10-26'::date ORDER BY i;
23+
i
24+
------------
25+
10-23-2004
26+
10-24-2004
27+
10-25-2004
28+
10-26-2004
29+
(4 rows)
30+
31+
SELECT * FROM test_date WHERE i='2004-10-26'::date ORDER BY i;
32+
i
33+
------------
34+
10-26-2004
35+
(1 row)
36+
37+
SELECT * FROM test_date WHERE i>='2004-10-26'::date ORDER BY i;
38+
i
39+
------------
40+
10-26-2004
41+
10-27-2004
42+
10-28-2004
43+
(3 rows)
44+
45+
SELECT * FROM test_date WHERE i>'2004-10-26'::date ORDER BY i;
46+
i
47+
------------
48+
10-27-2004
49+
10-28-2004
50+
(2 rows)
51+

‎expected/float4.out

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
set enable_seqscan=off;
2+
CREATE TABLE test_float4 (
3+
i float4
4+
);
5+
INSERT INTO test_float4 VALUES (-2),(-1),(0),(1),(2),(3);
6+
CREATE INDEX idx_float4 ON test_float4 USING rum (i);
7+
SELECT * FROM test_float4 WHERE i<1::float4 ORDER BY i;
8+
i
9+
----
10+
-2
11+
-1
12+
0
13+
(3 rows)
14+
15+
SELECT * FROM test_float4 WHERE i<=1::float4 ORDER BY i;
16+
i
17+
----
18+
-2
19+
-1
20+
0
21+
1
22+
(4 rows)
23+
24+
SELECT * FROM test_float4 WHERE i=1::float4 ORDER BY i;
25+
i
26+
---
27+
1
28+
(1 row)
29+
30+
SELECT * FROM test_float4 WHERE i>=1::float4 ORDER BY i;
31+
i
32+
---
33+
1
34+
2
35+
3
36+
(3 rows)
37+
38+
SELECT * FROM test_float4 WHERE i>1::float4 ORDER BY i;
39+
i
40+
---
41+
2
42+
3
43+
(2 rows)
44+

‎expected/float8.out

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
set enable_seqscan=off;
2+
CREATE TABLE test_float8 (
3+
i float8
4+
);
5+
INSERT INTO test_float8 VALUES (-2),(-1),(0),(1),(2),(3);
6+
CREATE INDEX idx_float8 ON test_float8 USING rum (i);
7+
SELECT * FROM test_float8 WHERE i<1::float8 ORDER BY i;
8+
i
9+
----
10+
-2
11+
-1
12+
0
13+
(3 rows)
14+
15+
SELECT * FROM test_float8 WHERE i<=1::float8 ORDER BY i;
16+
i
17+
----
18+
-2
19+
-1
20+
0
21+
1
22+
(4 rows)
23+
24+
SELECT * FROM test_float8 WHERE i=1::float8 ORDER BY i;
25+
i
26+
---
27+
1
28+
(1 row)
29+
30+
SELECT * FROM test_float8 WHERE i>=1::float8 ORDER BY i;
31+
i
32+
---
33+
1
34+
2
35+
3
36+
(3 rows)
37+
38+
SELECT * FROM test_float8 WHERE i>1::float8 ORDER BY i;
39+
i
40+
---
41+
2
42+
3
43+
(2 rows)
44+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp