Gin for PostgreSQL==================Gin was sponsored by jfg://networks (http://www.jfg-networks.com/)Gin stands for Generalized Inverted Index and should be considered as a genie,not a drink.Generalized means that the index does not know which operation it accelerates.It instead works with custom strategies, defined for specific data types (read"Index Method Strategies" in the PostgreSQL documentation). In that sense, Ginis similar to GiST and differs from btree indices, which have predefined,comparison-based operations.An inverted index is an index structure storing a set of (key, posting list)pairs, where 'posting list' is a set of documents in which the key occurs.(A text document would usually contain many keys.) The primary goal ofGin indices is support for highly scalable, full-text search in PostgreSQL.Gin consists of a B-tree index constructed over entries (ET, entries tree),where each entry is an element of the indexed value (element of array, lexemefor tsvector) and where each tuple in a leaf page is either a pointer to aB-tree over item pointers (PT, posting tree), or a list of item pointers(PL, posting list) if the tuple is small enough.Note: There is no delete operation for ET. The reason for this is that fromour experience, a set of unique words over a large collection change veryrarely. This greatly simplifies the code and concurrency algorithms.Gin comes with built-in support for one-dimensional arrays (eg. integer[],text[]), but no support for NULL elements. The following operations areavailable:* contains: value_array @ query_array* overlap: value_array && query_array* contained: value_array ~ query_arraySynopsis--------=# create index txt_idx on aa using gin(a);Features--------* Concurrency* Write-Ahead Logging (WAL). (Recoverability from crashes.)* User-defined opclasses. (The scheme is similar to GiST.)* Optimized index creation (Makes use of maintenance_work_mem to accumulatepostings in memory.)* Tsearch2 support via an opclass* Soft upper limit on the returned results set using a GUC variable:gin_fuzzy_search_limitGin Fuzzy Limit---------------There are often situations when a full-text search returns a very large set of
Leave a Comment