Get the App
SLTechnology News&Howtos  ›  Database  › 

PostgreSQL DBA (52)-Index (RUM)

Shulou Source: shulou.com Published: 2022-06-01 07:37:16 10月03日 Update

This section briefly introduces the RUM index in PostgreSQL, including the basic knowledge and structure of RUM index.

RUM index is an enhanced version of GIN index. Gin index only stores the location information of morphemes after word segmentation, so it is relatively inefficient in Recheck (scanning to verify whether morphemes meet the query conditions). Second, search is usually sorted according to the strength of relevance, but GIN does not have this information, so it can only be returned after calculation.

RUM index can avoid the above two problems.

Brief introduction

Compared with the GIN index and the RUM index, each morpheme refers not only to the TIDs in the table, but also to the linked list of the locations where the morpheme appears in the document.

Look at the following example:

Testdb=# create extension rum;CREATE EXTENSIONtestdb=# create index on ts using rum (doc_tsv); CREATE INDEXtestdb=# select ctid, left (doc,20), doc_tsv from ts Ctid | left | doc_tsv-+-- -(0Jing 10) | Can a sheet slitter | 'sheet':3,6' slit':5 'slitter':4 (0Magazine 11) | How many sheets coul |' could':4 'mani':2' sheet':3,6 'slit':8' slitter':7 (0Jol 12) | I slit a sheet A sh | 'sheet':4,6' slit':2,8 (0Magne13) | Upon a slitted sheet | 'sheet':4' sit':6 'slit':3' upon':1 (0Magne14) | Whoever slit the she | 'good':7' sheet':4,8 'slit':2' slitter':9 'whoever':1 (0Magne15) | I am a sheet slitter |' sheet':4 'slitter':5 (0Magne16) | I slit sheets. | | 'sheet':3' slit':2 (0rows 17) | I am the sleekest sh | 'ever':8' sheet':5,10 'sleekest':4' slit':9 'slitter':6 (0 rows 18) | She slits the sheet |' sheet':4 'sit':6' slit':2 (9 rows) |

Its structure is as follows:

TODO

references

Indexes in PostgreSQL-8 (RUM)

RUM

Tags: Index morpheme location information structure storage not only examples references basics basics regular meetings strength efficiency documents time conditions relevance knowledge introduction Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia vpn Xiaomi Apple MariaDB