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

Commit3068e40

Browse files
committed
Merge branch 'add_btree'
2 parents3bdca3d +0ba94fc commit3068e40

File tree

71 files changed

+4660
-819
lines changed

Some content is hidden

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

71 files changed

+4660
-819
lines changed

‎Makefile

Lines changed: 18 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 rum--1.0--1.1.sql
1723

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

@@ -31,6 +37,15 @@ 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+
rum--1.0--1.1.sql: Makefile gen_rum_sql--1.0--1.1.pl
47+
perl gen_rum_sql--1.0--1.1.pl> rum--1.0--1.1.sql
48+
3449
install: installincludes
3550

3651
installincludes:

‎README.md

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ Typical installation procedure may look like this:
5959
| timestamp<=| timestamp | float8 | Returns distance only for left timestamps.
6060
| timestamp|=> timestamp | float8 | Returns distance only for right timestamps.
6161

62+
Last three operations also works for types int2, int4, int8, float4, float8,
63+
money and oid.
64+
6265
##Operator classes
6366

6467
**rum** provides next operator classes.
@@ -128,35 +131,33 @@ For type: `tsvector`
128131
This operator class stores hash of`tsvector` lexemes with positional information.
129132
Supports ordering by`<=>` operator. But**doesn't** support prefix search.
130133

131-
###rum_timestamp_ops
132-
133-
For type:`timestamp`
134-
135-
Operator class provides fast search and ordering by timestamp fields. Supports
136-
ordering by`<=>`,`<=|` and`|=>` operators. Can be used with
137-
`rum_tsvector_timestamp_ops` operator class.
134+
###rum_TYPE_ops
138135

139-
###rum_timestamptz_ops
136+
For types: int2, int4, int8, float4, float8, money, oid, time, timetz, date,
137+
interval, macaddr, inet, cidr, text, varchar, char, bytea, bit, varbit,
138+
numeric, timestamp, timestamptz
140139

141-
For type:`timestamptz`
140+
Supported operations:`<`,`<=`,`=`,`>=`,`>` for all types and
141+
`<=>`,`<=|` and`|=>` for int2, int4, int8, float4, float8, money, oid,
142+
timestamp and timestamptz types.
142143

143-
Operator class provides fast search and ordering by timestamptz fields. Supports
144-
ordering by`<=>`,`<=|` and`|=>` operators. Can be used with
145-
`rum_tsvector_timestamptz_ops` operator class.
144+
Supports ordering by`<=>`,`<=|` and`|=>` operators. Can be used with
145+
`rum_tsvector_addon_ops` operator class.
146146

147-
###rum_tsvector_timestamp_ops
147+
###rum_tsvector_addon_ops
148148

149149
For type:`tsvector`
150150

151-
This operator class stores`tsvector` lexems with timestamp field. There is the example.
151+
This operator class stores`tsvector` lexems with any supported by module
152+
field. There is the example.
152153

153154
Let us assume we have the table:
154155
```sql
155156
CREATETABLEtsts (idint, t tsvector, dtimestamp);
156157

157158
\copy tstsfrom'rum/data/tsts.data'
158159

159-
CREATEINDEXtsts_idxON tsts USING rum (trum_tsvector_timestamp_ops, d)
160+
CREATEINDEXtsts_idxON tsts USING rum (trum_tsvector_addon_ops, d)
160161
WITH (attach='d', to='t');
161162
```
162163

@@ -183,24 +184,13 @@ SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY
183184
(5 rows)
184185
```
185186

186-
###rum_tsvector_timestamptz_ops
187+
###rum_tsvector_hash_addon_ops
187188

188189
For type:`tsvector`
189190

190-
See comments for`rum_tsvector_timestamp_ops` operator class.
191-
192-
###rum_tsvector_hash_timestamp_ops
193-
194-
For type:`tsvector`
195-
196-
This operator class stores hash of`tsvector` lexems with timestamp field.
197-
**Doesn't** support prefix search.
198-
199-
###rum_tsvector_hash_timestamptz_ops
200-
201-
For type:`tsvector`
191+
This operator class stores hash of`tsvector` lexems with any supported by module
192+
field.
202193

203-
This operator class stores hash of`tsvector` lexems with timestamptz field.
204194
**Doesn't** support prefix search.
205195

206196
###rum_tsquery_ops

‎TODO

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
1. with naturalOrder=true make scan the rest to be consistent with seqscan
2-
2. add leftlink to data page to privide backward scan on index (<=| op)
1+
1. with naturalOrder=true make scan the rest to be consistent with seqscan [done]
2+
2. add leftlink to data page to privide backward scan on index (<=| op) [done]
33
3. Compression of ItemPointer for use_alternative_order
44
4. Compression addInfo
5-
5. Remove FROM_STRATEGY ugly magick
5+
5. Remove FROM_STRATEGY ugly magick[done]
66

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

‎expected/altorder.out

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CREATE TABLE atsts (id int, t tsvector, d timestamp);
22
\copy atsts from 'data/tsts.data'
3-
CREATE INDEX atsts_idx ON atsts USING rum (trum_tsvector_timestamp_ops, d)
3+
CREATE INDEX atsts_idx ON atsts USING rum (trum_tsvector_addon_ops, d)
44
WITH (attach = 'd', to = 't', order_by_attach='t');
55
INSERT INTO atsts VALUES (-1, 't1 t2', '2016-05-02 02:24:22.326724');
66
INSERT INTO atsts VALUES (-2, 't1 t2 t3', '2016-05-02 02:26:22.326724');
@@ -323,4 +323,3 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER
323323
496 | Sun May 22 11:21:22.326724 2016
324324
(8 rows)
325325

326-
DROP TABLE atsts CASCADE;

‎expected/altorder_1.out

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,3 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER
322322
496 | Sun May 22 11:21:22.326724 2016
323323
(8 rows)
324324

325-
DROP TABLE atsts CASCADE;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp