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

Update README with small language tweaks#114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
feodor merged 1 commit intopostgrespro:masterfromshadforth:update-readme
Sep 19, 2022
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 34 additions & 33 deletionsREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,38 +8,38 @@

## Introduction

The **rum** module provides access method to work with `RUM` index. It is based
on the `GIN` accessmethods code.
The **rum** module providesanaccess method to work with a `RUM` index. It is based
on the `GIN` accessmethod's code.

`GIN` index allowsto performfast fulltext search using `tsvector` and
`tsquery` types. But fulltext search with GIN index has several problems:
A`GIN` index allowsperformingfast full-text search using `tsvector` and
`tsquery` types. But full-text search with a GIN index has several problems:

- Slow ranking. Itis need positioninformation aboutlexems to ranking. `GIN`
index doesn't store positions oflexems. So after indexscan we needadditional
heap scan to retrievelexems positions.
- Slow phrase search with `GIN` index. This problem relateswith previous
problem. Itis need position information to perform phrase search.
- Slow ordering by timestamp. `GIN` index can't store some related information
in index with lexemes. So it is necessary to perform additional heap scan.
- Slow ranking. Itneeds positionalinformation aboutlexemes todoranking. A `GIN`
index doesn't store positions oflexemes. So after indexscanning, we needan
additionalheap scan to retrievelexeme positions.
- Slow phrase search witha`GIN` index. This problem relatesto the previous
problem. Itneeds positional information to perform phrase search.
- Slow ordering by timestamp.A`GIN` index can't store some related information
intheindex with lexemes. So it is necessary to perform an additional heap scan.

`RUM` solvesthis problems by storing additional information in posting tree.
`RUM` solvesthese problems by storing additional information in a posting tree.
For example, positional information of lexemes or timestamps. You can get an
idea of `RUM`by the followingpicture:
idea of `RUM`with the followingdiagram:

![How RUM stores additional information](img/gin_rum.png)

Drawbackof `RUM` is that it has slower build and inserttime than `GIN`.
It is because we need to store additional information besides keys and because
`RUM` uses generic WAL records.
A drawbackof `RUM` is that it has slower build and inserttimes than `GIN`.
This is because we need to store additional information besides keys and because
`RUM` uses genericWrite-Ahead Log (WAL) records.

## License

This module available under the [license](LICENSE) similar to
This moduleisavailable under the [license](LICENSE) similar to
[PostgreSQL](http://www.postgresql.org/about/licence/).

## Installation

Beforebuild andinstall **rum** you should ensure following:
Beforebuilding andinstalling **rum**, you should ensure following are installed:

* PostgreSQL version is 9.6+.

Expand All@@ -62,7 +62,7 @@ Typical installation procedure may look like this:

## Common operators and functions

**rum** module provides next operators.
The**rum** module provides next operators.

| Operator | Returns | Description
| -------------------- | ------- | ----------------------------------------------
Expand All@@ -71,19 +71,19 @@ Typical installation procedure may look like this:
| timestamp <=| timestamp | float8 | Returns distance only for left timestamps.
| timestamp |=> timestamp | float8 | Returns distance only for right timestamps.

Lastthree operations alsoworks for types timestamptz, int2, int4, int8, float4, float8,
The lastthree operations alsowork for types timestamptz, int2, int4, int8, float4, float8,
money and oid.

## Operator classes

**rum** providesnext operator classes.
**rum** providesthe following operator classes.

### rum_tsvector_ops

For type: `tsvector`

This operator class stores `tsvector` lexemes with positional information.Supports
ordering by `<=>` operator and prefix search.There isthe example.
This operator class stores `tsvector` lexemes with positional information.It supports
ordering bythe`<=>` operator and prefix search.Seethe example below.

Let us assume we have the table:

Expand DownExpand Up@@ -140,8 +140,8 @@ SELECT t, a <=> to_tsquery('english', 'place | situation') AS rank

For type: `tsvector`

This operator class stores hash of `tsvector` lexemes with positional information.
Supportsordering by `<=>` operator.But **doesn't** support prefix search.
This operator class storesahash of `tsvector` lexemes with positional information.
It supportsordering bythe`<=>` operator.It **doesn't** support prefix search.

### rum_TYPE_ops

Expand All@@ -153,17 +153,18 @@ Supported operations: `<`, `<=`, `=`, `>=`, `>` for all types and
`<=>`, `<=|` and `|=>` for int2, int4, int8, float4, float8, money, oid,
timestamp and timestamptz types.

Supportsordering by `<=>`, `<=|` and `|=>` operators.Can be used with
This operator supportsordering bythe`<=>`, `<=|` and `|=>` operators.It can be used with
`rum_tsvector_addon_ops`, `rum_tsvector_hash_addon_ops' and `rum_anyarray_addon_ops` operator classes.

### rum_tsvector_addon_ops

For type: `tsvector`

This operator class stores `tsvector`lexems with any supported by module
field.There isthe example.
This operator class stores `tsvector`lexemes with any supported by module
field.Seethe example below.

Let us assume we have the table:

```sql
CREATE TABLE tsts (id int, t tsvector, d timestamp);

Expand DownExpand Up@@ -202,16 +203,16 @@ SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY

For type: `tsvector`

This operator class stores hash of `tsvector`lexems with any supported by module
This operator class storesahash of `tsvector`lexemes with any supported by module
field.

**Doesn't** support prefix search.
It **doesn't** support prefix search.

### rum_tsquery_ops

For type: `tsquery`

Storesbranches of query tree in additional information. For example we have the table:
It storesbranches of query tree in additional information. For example, we have the table:
```sql
CREATE TABLE query (q tsquery, tag text);

Expand DownExpand Up@@ -240,8 +241,8 @@ SELECT * FROM query
For type: `anyarray`

This operator class stores `anyarray` elements with length of the array.
Supportsoperators `&&`, `@>`, `<@`, `=`, `%` operators.Supports ordering by `<=>` operator.
For example we have the table:
It supportsoperators `&&`, `@>`, `<@`, `=`, `%` operators.It also supports ordering by `<=>` operator.
For example, we have the table:

```sql
CREATE TABLE test_array (i int2[]);
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp