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

Commit62e1800

Browse files
committed
Add 'contrib/rum/' from commit 'e8f34ec03a6ee92f5b132bbe4e1f252a4e46101f'
git-subtree-dir: contrib/rumgit-subtree-mainline:f43f84cgit-subtree-split:e8f34ec
2 parentsf43f84c +e8f34ec commit62e1800

39 files changed

+20516
-0
lines changed

‎contrib/rum/.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.deps
2+
*.o
3+
*.so
4+
results
5+
__pycache__
6+
*.pyc
7+
tmp_install
8+
9+
# virtualenv
10+
bin
11+
include
12+
lib
13+
pip-selfcheck.json
14+

‎contrib/rum/Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# contrib/rum/Makefile
2+
3+
MODULE_big = rum
4+
OBJS = rumsort.o rum_ts_utils.o rumtsquery.o\
5+
rumbtree.o rumbulk.o rumdatapage.o\
6+
rumentrypage.o rumget.o ruminsert.o\
7+
rumscan.o rumutil.o rumvacuum.o rumvalidate.o\
8+
rum_timestamp.o$(WIN32RES)
9+
10+
EXTENSION = rum
11+
DATA = rum--1.0.sql
12+
PGFILEDESC = "RUM index access method"
13+
14+
REGRESS = rum ruminv timestamp orderby altorder
15+
16+
ifdefUSE_PGXS
17+
PG_CONFIG = pg_config
18+
PGXS :=$(shell$(PG_CONFIG) --pgxs)
19+
include$(PGXS)
20+
else
21+
subdir = contrib/rum
22+
top_builddir = ../..
23+
include$(top_builddir)/src/Makefile.global
24+
include$(top_srcdir)/contrib/contrib-global.mk
25+
endif
26+
27+
wal-check: temp-install
28+
$(prove_check)

‎contrib/rum/README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#RUM - RUM access method
2+
3+
##Introduction
4+
5+
The**rum** module provides access method to work with RUM index. It is based
6+
on the GIN access methods code.
7+
8+
##License
9+
10+
This module available under the same license as
11+
[PostgreSQL](http://www.postgresql.org/about/licence/).
12+
13+
##Installation
14+
15+
Before build and install**rum** you should ensure following:
16+
17+
* PostgreSQL version is 9.6.
18+
19+
Typical installation procedure may look like this:
20+
21+
$ git clone https://github.com/postgrespro/rum
22+
$ cd rum
23+
$ make USE_PGXS=1
24+
$ sudo make USE_PGXS=1 install
25+
$ make USE_PGXS=1 installcheck
26+
$ psql DB -c "CREATE EXTENSION rum;"
27+
28+
##New access method and operator class
29+
30+
The**rum** module provides the access method**rum** and the operator class
31+
**rum_tsvector_ops**.
32+
33+
The module provides new operators.
34+
35+
| Operator | Returns | Description
36+
| -------------------- | ------- | ----------------------------------------------
37+
| tsvector<=> tsquery | float4 | Returns distance between tsvector and tsquery.
38+
39+
##Examples
40+
41+
Let us assume we have the table:
42+
43+
```sql
44+
CREATETABLEtest_rum(ttext, a tsvector);
45+
46+
CREATETRIGGERtsvectorupdate
47+
BEFOREUPDATEOR INSERTON test_rum
48+
FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('a','pg_catalog.english','t');
49+
50+
INSERT INTO test_rum(t)VALUES ('The situation is most beautiful');
51+
INSERT INTO test_rum(t)VALUES ('It is a beautiful');
52+
INSERT INTO test_rum(t)VALUES ('It looks like a beautiful place');
53+
```
54+
55+
To create the**rum** index we need create an extension:
56+
57+
```sql
58+
CREATE EXTENSION rum;
59+
```
60+
61+
Then we can create new index:
62+
63+
```sql
64+
CREATEINDEXrumidxON test_rum USING rum (a rum_tsvector_ops);
65+
```
66+
67+
And we can execute the following queries:
68+
69+
```sql
70+
=# SELECT t, a <=> to_tsquery('english', 'beautiful | place') AS rank
71+
FROM test_rum
72+
WHERE a @@ to_tsquery('english','beautiful | place')
73+
ORDER BY a<=> to_tsquery('english','beautiful | place');
74+
t | rank
75+
---------------------------------+-----------
76+
The situation is most beautiful |0.0303964
77+
It is a beautiful |0.0303964
78+
It lookslike a beautiful place |0.0607927
79+
(3 rows)
80+
81+
=# SELECT t, a <=> to_tsquery('english', 'place | situation') AS rank
82+
FROM test_rum
83+
WHERE a @@ to_tsquery('english','place | situation')
84+
ORDER BY a<=> to_tsquery('english','place | situation');
85+
t | rank
86+
---------------------------------+-----------
87+
The situation is most beautiful |0.0303964
88+
It lookslike a beautiful place |0.0303964
89+
(2 rows)
90+
```
91+
92+
##Authors
93+
94+
Alexander Korotkov <a.korotkov@postgrespro.ru> Postgres Professional Ltd., Russia
95+
96+
Oleg Bartunov<oleg@sai.msu.su> Postgres Professional Ltd., Russia
97+
98+
Teodor Sigaev<teodor@sigaev.ru> Postgres Professional Ltd., Russia

‎contrib/rum/TODO

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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)
3+
3. Compression of ItemPointer for use_alternative_order
4+
4. Compression addInfo
5+
5. Remove FROM_STRATEGY ugly magick
6+

‎contrib/rum/data/rum.data

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
As a reward for your reformation I write to you on this precious sheet.
2+
You see I have come to be wonderfully attached to Heidelberg, the
3+
beautiful, the quaint, the historically poetic, learned and picturesque
4+
old town on the Neckar. It seems like another home. So I could not show
5+
my appreciation of you in a more complimentary way than by sending this
6+
little series of pictures. Have you ever been here, I wonder? You did
7+
not say, but you wrote as if you knew it by sight as well as by heart.
8+
As I cannot know, I will venture an explanation. The panorama speaks for
9+
itself. Put on your “specs” and look at the castle, half way up the
10+
_berg_, “the Jettenhuhl, a wooded spur of the Konigestuhl.” Look at it
11+
from the “Terrasse.” Thus you’ll get something of an idea of it. The
12+
Gesprente Thurm is the one that was blown up by the French. The
13+
thickness of the walls, twenty-one feet, and the solid masonry, held it
14+
so well that only a fragment, as it were, gave way. It still hangs as if
15+
ready to be replaced. “Das Grosse Fass Gebaude,” too, you will have no
16+
difficulty in making out. If you only had it with its 49,000 gallons of
17+
wine, but wouldn’t you divide with your neighbors! The columns in the
18+
portico that shows in the Schlosshof are the four brought from
19+
Charlemagne’s palace at Ingelheim by the Count Palatine Ludwig, some
20+
time between 1508-44. The Zum Ritter has nothing to do with the castle,
21+
but is an ancient structure (1592) in the Renaissance style, and one of
22+
the few that escaped destruction in 1693. It is a beautiful, highly
23+
ornamental building, and I wish you could see it, if you have not seen
24+
it.
25+
26+
All the above information, I beg you to believe, I do not intend you
27+
to think was evolved from my inner consciousness, but gathered from
28+
the--nearest guide-book!
29+
30+
I am so much obliged to you for mapping out Switzerland to me. I have
31+
been trying my best to get all those “passes” into my brain. Now, thanks
32+
to your letter, I have them all in the handiest kind of a bunch. Ariel
33+
like, “I’ll do my bidding gently,” and as surely, if I get there. But
34+
there are dreadful reports of floods and roads caved in and bridges
35+
swept away and snows and--enough of such exciting items as sets one
36+
thinking--“to go or not to go?” We are this far on the way. Reached
37+
here this afternoon. Have spent the evening sauntering in the gardens,
38+
the Conversationhaus, the bazaar, mingling with the throng, listening to
39+
the band, and comparing what it is with what it was. It was a gay and
40+
curious spectacle, but on the whole had “the banquet-hall deserted”
41+
look. The situation is most beautiful. It lies, you know, at the
42+
entrance of the Black Forest, among picturesque, thickly-wooded hills,
43+
in the valley of the Oos, and extends up the slope of some of the hills.
44+
The Oos is a most turbid, turbulent stream; dashes through part of the
45+
town with angry, headlong speed. There is an avenue along its bank of
46+
oaks, limes and maples, bordered with flower-beds and shrubberies, and
47+
adorned with fountains and handsome villas. We shall devote to-morrow to
48+
seeing all there is to be seen, and go to Strassburg to-morrow evening
49+
for two or three days. From there to Constance, and then hold _our_
50+
“Council” as to further movements.
51+
def fgr
52+
def xxx fgr

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp