GIN documentation
GIN documentation
Patch adds GIN documentation and slightly improves GiST docs. Somebody of native English speakers, pls, check the text... Thank you.
Re: GIN documentation
On Wed, 2006-09-13 at 14:24 +0400, Teodor Sigaev wrote: > Patch adds GIN documentation and slightly improves GiST docs. > > Somebody of native English speakers, pls, check the text... Thank you. I have some minor changes that reworded some parts that were confusing to me. I don't fully understand GIN, but I hope this is helpful. Regards, Jeff Davis
Re: GIN documentation
От:
David Fuhry <dfuhry@cs.kent.edu>
Дата:
Teodor,
Attached is a diff -c against your original gindocs patch. I did my
best not to change any of the semantics. My changes no doubt overlap &
conflict with those Jeff Davis sent you earlier, so consider both of our
diffs.
Thanks,
Dave Fuhry
Teodor Sigaev wrote:
> Patch adds GIN documentation and slightly improves GiST docs.
>
> Somebody of native English speakers, pls, check the text... Thank you.
>
>
> ------------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
*** gindocs.orig 2006-09-17 00:21:38.000000000 -0400
--- gindocs 2006-09-17 00:57:12.000000000 -0400
***************
*** 22,28 ****
!
!
!
! ! Soft upper limit of the size of the returned set by GIN index. For more
! information see .
!
!
--- 22,28 ----
!
!
!
! ! Soft upper limit of the size of the set returned by the GIN index. For more
! information see .
!
!
***************
*** 88,95 ****
+
+ GIN stands for Generalized Inverted Index. It is
+ an index structure storing a set of (key, posting list) pairs, where
! + 'posting list' is a set of rows in which the key occurs. The
! + row may contains a lot of keys.
+
+
+
--- 88,95 ----
+
+ GIN stands for Generalized Inverted Index. It is
+ an index structure storing a set of (key, posting list) pairs, where
! + 'posting list' is a set of rows in which the key occurs. Each
! + row may contain many keys.
+
+
+
***************
*** 178,184 ****
+
+
+ Returns an array of keys of the query to be executed. n contains
! + strategy number of operation (see ).
+ Depending on n, query may be different type.
+
+
--- 178,184 ----
+
+
+ Returns an array of keys of the query to be executed. n contains
! + the strategy number of the operation (see ).
+ Depending on n, query may be different type.
+
+
***************
*** 188,196 ****
+ bool consistent( bool check[], StrategyNumber n, Datum query)
+
+
! + Returns TRUE if indexed value satisfies query qualifier with strategy n
+ (or may satisfy in case of RECHECK mark in operator class).
! + Each element of the check array is TRUE if indexed value has a
+ corresponding key in the query: if (check[i] == TRUE ) the i-th key of
+ the query is present in the indexed value.
+
--- 188,196 ----
+ bool consistent( bool check[], StrategyNumber n, Datum query)
+
+
! + Returns TRUE if the indexed value satisfies the query qualifier with strategy n
+ (or may satisfy in case of RECHECK mark in operator class).
! + Each element of the check array is TRUE if the indexed value has a
+ corresponding key in the query: if (check[i] == TRUE ) the i-th key of
+ the query is present in the indexed value.
+
***************
*** 209,218 ****
+ Create vs insert
+
+
! + In most cases, insertion into GIN index is slow enough
! + due to a lot keys should be inserted per one value. So, for bulk upload
! + data in table it will be useful to drop index and create it
! + after finishing upload.
+
+
+
--- 209,218 ----
+ Create vs insert
+
+
! + In most cases, insertion into a GIN index is slow
! + due to the likelihood of many keys being inserted for each value. So, for bulk insertions into a
! + table it is advisable to to drop the GIN index and recreate it
! + after finishing bulk insertion.
+
+
+
***************
*** 221,227 ****
+ gin_fuzzy_search_limit
+
+
! + The primary goal of development GIN indices was
+ support for highly scalable, full-text search in
+ PostgreSQL and there are often situations when
+ a full-text search returns a very large set of results. Since reading
--- 221,227 ----
+ gin_fuzzy_search_limit
+
+
! + The primary goal of developing GIN indices was
+ support for highly scalable, full-text search in
+ PostgreSQL and there are often situations when
+ a full-text search returns a very large set of results. Since reading
***************
*** 232,238 ****
+
+ Such queries usually contain very frequent words, so the results are not
+ very helpful. To facilitate execution of such queries
! + GIN has a configurable soft upper limit of the size
+ of the returned set, determined by the
+ gin_fuzzy_search_limit GUC variable. It is set to 0 by
+ default (no limit).
--- 232,238 ----
+
+ Such queries usually contain very frequent words, so the results are not
+ very helpful. To facilitate execution of such queries
! + GIN has a configurable soft upper limit of the size
+ of the returned set, determined by the
+ gin_fuzzy_search_limit GUC variable. It is set to 0 by
+ default (no limit).
***************
*** 256,271 ****
+ Limitations
+
+
! + GIN doesn't support full scan of index due to it's
! + extremely inefficiency: because of a lot of keys per value,
+ each heap pointer will returned several times.
+
+
+
! + When extractQuery returns zero number of keys, GIN will
! + emit a error: for different opclass and strategy semantic meaning of void
! + query may be different (for example, any array contains void array,
! + but they aren't overlapped with void one), and GIN can't
+ suggest reasonable answer.
+
+
--- 256,271 ----
+ Limitations
+
+
! + GIN doesn't support full index scans due to their
! + extremely inefficiency: because there are often many keys per value,
+ each heap pointer will returned several times.
+
+
+
! + When extractQuery returns zero keys, GIN will
! + emit a error: for different opclasses and strategies the semantic meaning of a void
! + query may be different (for example, any array contains the void array,
! + but they don't overlap the void array), and GIN can't
+ suggest reasonable answer.
+
+
***************
*** 340,346 ****
+ index
+
+ GIN is a inverted index and it's usable for values which have more
! + than one key, arrays for example. Like to GiST, GIN may support
+ many different user-defined indexing strategies and the particular
+ operators with which a GIN index can be used vary depending on the
+ indexing strategy.
--- 340,346 ----
+ index
+
+ GIN is a inverted index and it's usable for values which have more
! + than one key, arrays for example. Like GiST, GIN may support
+ many different user-defined indexing strategies and the particular
+ operators with which a GIN index can be used vary depending on the
+ indexing strategy.
***************
*** 358,364 ****
+
+ (See for the meaning of
+ these operators.)
! + Another GIN operator classes are available in the contrib</>
+ tsearch2 and intarray modules. For more information see .
--- 358,364 ----
+
+ (See for the meaning of
+ these operators.)
! + Other GIN operator classes are available in the contrib</>
+ tsearch2 and intarray modules. For more information see .
***************
*** 381,389 ****
+
+ Short-term share/exclusive page-level locks are used for
+ read/write access. Locks are released immediately after each
! + index row is fetched or inserted. But note, that GIN index
! + usually requires produce several inserts per one row, so,
! + GIN makes more work per one value's insertion.
+
+
+
--- 381,390 ----
+
+ Short-term share/exclusive page-level locks are used for
+ read/write access. Locks are released immediately after each
! + index row is fetched or inserted. But note that a GIN-indexed
! + value insertion usually produces several index key insertions
! + per row, so GIN may do substantial work for a single value's
! + insertion.
+
+
+
***************
*** 436,443 ****
! + GIN indexes are similar to GiST in flexibility: it hasn't a fixed set
! + of strategies. Instead, the consistency</> support routine
+ interprets the strategy numbers accordingly with operator class
+ definition. As an example, strategies of operator class over arrays
+ is shown in .
--- 437,444 ----
! + GIN indexes are similar to GiST's in flexibility: they don't have a fixed
! + set of strategies. Instead, the consistency</> support routine
+ interprets the strategy numbers accordingly with operator class
+ definition. As an example, strategies of operator class over arrays
+ is shown in .