Skip to content

rum

rum : RUM index access method

Overview

ID Extension Package Version Category License Language
2720
rum
rum
1.3.15
FEAT
PostgreSQL
C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d-r
No
Yes
No
Yes
yes
no
Relationships
Need By
documentdb
See Also
pg_trgm
btree_gist
btree_gin
pg_search
pgroonga
pg_bigm
zhparser
pgroonga_database

1.3.15 build pass on pg 16,17,18

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
MIXED
1.3.15
18
17
16
15
14
rum -
RPM
PIGSTY
1.3.15
18
17
16
15
14
rum_$v -
DEB
PGDG
1.3.15
18
17
16
15
14
postgresql-$v-rum -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 1.3.15
PIGSTY 1.3.15
PIGSTY 1.3.15
PGDG 1.3.14
PGDG 1.3.14
el8.aarch64
PIGSTY 1.3.15
PIGSTY 1.3.15
PIGSTY 1.3.15
PGDG 1.3.14
PGDG 1.3.14
el9.x86_64
PIGSTY 1.3.15
PIGSTY 1.3.15
PIGSTY 1.3.15
PGDG 1.3.14
PGDG 1.3.14
el9.aarch64
PIGSTY 1.3.15
PIGSTY 1.3.15
PIGSTY 1.3.15
PGDG 1.3.14
PGDG 1.3.14
el10.x86_64
PIGSTY 1.3.15
PIGSTY 1.3.15
PIGSTY 1.3.15
PGDG 1.3.14
PGDG 1.3.14
el10.aarch64
PIGSTY 1.3.15
PIGSTY 1.3.15
PIGSTY 1.3.15
PGDG 1.3.14
PGDG 1.3.14
d12.x86_64
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
d12.aarch64
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
d13.x86_64
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
d13.aarch64
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
u22.x86_64
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
u22.aarch64
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
u24.x86_64
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
u24.aarch64
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
u26.x86_64
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
u26.aarch64
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
PGDG 1.3.15
Package Version OS ORG SIZE File URL
rum_18 1.3.15 el8.x86_64 pigsty 104.0 KiB rum_18-1.3.15-1PIGSTY.el8.x86_64.rpm
rum_18 1.3.15 el8.aarch64 pigsty 97.5 KiB rum_18-1.3.15-1PIGSTY.el8.aarch64.rpm
rum_18 1.3.15 el9.x86_64 pigsty 96.2 KiB rum_18-1.3.15-1PIGSTY.el9.x86_64.rpm
rum_18 1.3.15 el9.aarch64 pigsty 92.7 KiB rum_18-1.3.15-1PIGSTY.el9.aarch64.rpm
rum_18 1.3.15 el10.x86_64 pigsty 97.1 KiB rum_18-1.3.15-1PIGSTY.el10.x86_64.rpm
rum_18 1.3.15 el10.aarch64 pigsty 93.6 KiB rum_18-1.3.15-1PIGSTY.el10.aarch64.rpm
postgresql-18-rum 1.3.15 d12.x86_64 pgdg 233.3 KiB postgresql-18-rum_1.3.15-1.pgdg12+1_amd64.deb
postgresql-18-rum 1.3.15 d12.aarch64 pgdg 225.4 KiB postgresql-18-rum_1.3.15-1.pgdg12+1_arm64.deb
postgresql-18-rum 1.3.15 d13.x86_64 pgdg 233.5 KiB postgresql-18-rum_1.3.15-1.pgdg13+1_amd64.deb
postgresql-18-rum 1.3.15 d13.aarch64 pgdg 226.2 KiB postgresql-18-rum_1.3.15-1.pgdg13+1_arm64.deb
postgresql-18-rum 1.3.15 u22.x86_64 pgdg 240.5 KiB postgresql-18-rum_1.3.15-1.pgdg22.04+1_amd64.deb
postgresql-18-rum 1.3.15 u22.aarch64 pgdg 232.1 KiB postgresql-18-rum_1.3.15-1.pgdg22.04+1_arm64.deb
postgresql-18-rum 1.3.15 u24.x86_64 pgdg 234.3 KiB postgresql-18-rum_1.3.15-1.pgdg24.04+1_amd64.deb
postgresql-18-rum 1.3.15 u24.aarch64 pgdg 226.3 KiB postgresql-18-rum_1.3.15-1.pgdg24.04+1_arm64.deb
postgresql-18-rum 1.3.15 u26.x86_64 pgdg 232.5 KiB postgresql-18-rum_1.3.15-1.pgdg26.04+1_amd64.deb
postgresql-18-rum 1.3.15 u26.aarch64 pgdg 223.8 KiB postgresql-18-rum_1.3.15-1.pgdg26.04+1_arm64.deb

Source

pig build pkg rum;		# build rpm

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install rum;		# install via package name, for the active PG version

pig install rum -v 18;   # install for PG 18
pig install rum -v 17;   # install for PG 17
pig install rum -v 16;   # install for PG 16
pig install rum -v 15;   # install for PG 15
pig install rum -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION rum;

Usage

rum: RUM index access method

RUM is an index access method that extends GIN by storing additional information in the posting tree. This enables direct access to positional data, avoiding extra heap scans for ranking, phrase searches, and timestamp ordering.

Index Creation

CREATE INDEX idx ON table_name USING rum (column operator_class);

With addon operators (e.g., ordering by a timestamp alongside full-text search):

CREATE INDEX tsts_idx ON tsts USING rum (t rum_tsvector_addon_ops, d)
    WITH (attach = 'd', to = 't');

Operator Classes

Operator Class Description
rum_tsvector_ops Stores tsvector lexemes with positions. Supports <=> ordering and prefix search.
rum_tsvector_hash_ops Stores hashed tsvector lexemes with positions. Supports <=> ordering, no prefix search.
rum_tsvector_addon_ops Combines tsvector with additional fields (timestamps, integers, etc.) for filtering and ordering.
rum_tsvector_hash_addon_ops Hashed variant supporting addon fields, no prefix search.
rum_tsquery_ops Stores tsquery branches for fast query matching against indexed documents.
rum_anyarray_ops Indexes array types. Supports &&, @>, <@, =, % and <=> ordering.
rum_anyarray_addon_ops Combines array elements with additional fields.
rum_TYPE_ops Generic ops for int2, int4, int8, float4, float8, money, oid, time, timetz, date, interval, macaddr, inet, cidr, text, varchar, char, bytea, bit, varbit, numeric, timestamp, timestamptz.

Ordering Operators

Operator Description
<=> Distance operator for tsvector, timestamp, numeric types, arrays
<=| Left-side distance for timestamp, int, float, money, oid
|=> Right-side distance for timestamp, int, float, money, oid

Examples

Full-text search with ranking:

SELECT t, a <=> to_tsquery('english', 'beautiful | place') AS rank
FROM test_rum
WHERE a @@ to_tsquery('english', 'beautiful | place')
ORDER BY a <=> to_tsquery('english', 'beautiful | place');

Timestamp-ordered full-text search:

SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts
WHERE t @@ 'wr&qh'
ORDER BY d <=> '2016-05-16 14:21:25'
LIMIT 5;

Array matching with distance ordering:

SELECT * FROM test_array
WHERE i && '{1}'
ORDER BY i <=> '{1}' ASC;
Last updated on