PostgreSQL DBA(52) - Index(RUM)
本節簡單介紹了PostgreSQL中的RUM索引,包括RUM索引的基礎知識和結構等.
RUM索引是GIN索引的增強版.GIN索引一是隻儲存詞素沒有儲存分詞後的詞素的位置資訊,因此在Recheck(掃描驗證詞素是否滿足查詢條件)的時候效率相對較低,二是搜尋通常會按相關性的強弱排序返回,但GIN沒有這些資訊,只能通過計算後返回.
RUM索引可以避免上述2個問題.
簡介
相對於GIN索引,RUM索引,每個詞素不僅僅引用表中的行(TIDs),還包括詞素在文件中出現的位置連結串列.
看下面的例子:
testdb=# create extension rum;
CREATE EXTENSION
testdb=# create index on ts using rum(doc_tsv);
CREATE INDEX
testdb=# select ctid, left(doc,20), doc_tsv from ts;
ctid | left | doc_tsv
--------+----------------------+---------------------------------------------------------
(0,10) | Can a sheet slitter | 'sheet':3,6 'slit':5 'slitter':4
(0,11) | How many sheets coul | 'could':4 'mani':2 'sheet':3,6 'slit':8 'slitter':7
(0,12) | I slit a sheet, a sh | 'sheet':4,6 'slit':2,8
(0,13) | Upon a slitted sheet | 'sheet':4 'sit':6 'slit':3 'upon':1
(0,14) | Whoever slit the she | 'good':7 'sheet':4,8 'slit':2 'slitter':9 'whoever':1
(0,15) | I am a sheet slitter | 'sheet':4 'slitter':5
(0,16) | I slit sheets. | 'sheet':3 'slit':2
(0,17) | I am the sleekest sh | 'ever':8 'sheet':5,10 'sleekest':4 'slit':9 'slitter':6
(0,18) | She slits the sheet | 'sheet':4 'sit':6 'slit':2
(9 rows)
其結構如下:
TODO
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/6906/viewspace-2650094/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- PostgreSQL DBA(59) - Index(Bloom)SQLIndexOOM
- PostgreSQL DBA(47) - Index(Btree)SQLIndex
- PostgreSQL DBA(48) - Index(GiST)SQLIndex
- PostgreSQL DBA(51) - Index(GIN)SQLIndex
- PostgreSQL DBA(43) - Index(Hash)SQLIndex
- PostgreSQL DBA(53) - Index(BRIN)SQLIndex
- PostgreSQL DBA(41) - PG Index PropertiesSQLIndex
- PostgreSQL DBA(170) - pgAdmin(Queries For Index Maintenance)SQLIndexAINaN
- PostgreSQL DBA(49) - Index(SP-GiST)SQLIndex
- PostgreSQL DBA(119) - pgAdmin(LIMIT:Index Scan vs Bitmap Index Scan)SQLMITIndex
- PostgreSQL DBA(177) - Serializability Isolation(Index vs NonIndex)SQLIndex
- PostgreSQL DBA(139) - PG 12(B-tree index improvement 1#)SQLIndex
- PostgreSQL:INDEXSQLIndex
- PostgreSQL DBA(45) - Hypothetical Indexes in PostgreSQLSQLIndex
- PostgreSQL DBA(58) - DBLinkSQL
- PostgreSQL DBA(35) - CTESQL
- PostgreSQL DBA(42) - localeSQL
- PostgreSQL DBA(191) - CollationSQL
- PostgreSQL DBA(185) - watchSQL
- PostgreSQL DBA(182) - HOTSQL
- PostgreSQL DBA(133) - Extension(postgresql_anonymizer)SQL
- PostgreSQL DBA(181) - Using PostgreSQL as a Data WarehouseSQL
- 【INDEX】Postgresql索引介紹IndexSQL索引
- PostgreSQL DBA(91) - PG upgradeSQL
- PostgreSQL DBA(150) - Extension(pgmetrics)SQL
- PostgreSQL DBA(187) - TCP keepaliveSQLTCP
- PostgreSQL DBA(186) - SQL Group BySQL
- PostgreSQL DBA(184) - Extension(hypoPG)SQL
- PostgreSQL DBA(142) - PG 12(Monitoring PostgreSQL VACUUM processes)SQL
- PostgreSQL DBA(7) - pgbench簡介SQL
- PostgreSQL DBA(8) - sysbench簡介SQL
- PostgreSQL DBA(136) - Develop(Common Mistakes)SQLdev
- PostgreSQL DBA(125) - PG 12(TPCC)SQL
- PostgreSQL DBA(122) - Develop(EDB package)SQLdevPackage
- PostgreSQL DBA(120) - pgAdmin(HA with Patroni)SQL
- PostgreSQL DBA(86) - Table Parameter(fillfactor)SQL
- PostgreSQL DBA(87) - benchmarksql簡介SQL
- PostgreSQL DBA(80) - Object Identifier TypesSQLObjectIDE