Home Explore Blog CI



postgresql

10th chunk of `doc/src/sgml/gin.sgml`
a96f3328ab82620c90f5cfe1a3351352c093e0932083f0cd00000001000008dc
 to
     skimp on work memory during index creation.
    </para>
   </listitem>
  </varlistentry>

  <varlistentry>
   <term><xref linkend="guc-gin-pending-list-limit"/></term>
   <listitem>
    <para>
     During a series of insertions into an existing <acronym>GIN</acronym>
     index that has <literal>fastupdate</literal> enabled, the system will clean up
     the pending-entry list whenever the list grows larger than
     <varname>gin_pending_list_limit</varname>. To avoid fluctuations in observed
     response time, it's desirable to have pending-list cleanup occur in the
     background (i.e., via autovacuum).  Foreground cleanup operations
     can be avoided by increasing <varname>gin_pending_list_limit</varname>
     or making autovacuum more aggressive.
     However, enlarging the threshold of the cleanup operation means that
     if a foreground cleanup does occur, it will take even longer.
    </para>
    <para>
     <varname>gin_pending_list_limit</varname> can be overridden for individual
     GIN indexes by changing storage parameters, which allows each
     GIN index to have its own cleanup threshold.
     For example, it's possible to increase the threshold only for the GIN
     index which can be updated heavily, and decrease it otherwise.
    </para>
   </listitem>
  </varlistentry>

  <varlistentry>
   <term><xref linkend="guc-gin-fuzzy-search-limit"/></term>
   <listitem>
    <para>
     The primary goal of developing <acronym>GIN</acronym> indexes was
     to create support for highly scalable full-text search in
     <productname>PostgreSQL</productname>, and there are often situations when
     a full-text search returns a very large set of results.  Moreover, this
     often happens when the query contains very frequent words, so that the
     large result set is not even useful.  Since reading many
     tuples from the disk and sorting them could take a lot of time, this is
     unacceptable for production.  (Note that the index search itself is very
     fast.)
    </para>
    <para>
     To facilitate controlled execution of such queries,
     <acronym>GIN</acronym> has a configurable soft upper limit on the
     number of rows returned: the
     <varname>gin_fuzzy_search_limit</varname> configuration

Title: GIN Index Configuration and Optimization
Summary
To optimize GIN index performance, it's recommended to avoid skimping on work memory during index creation, and to configure settings such as the pending list limit and fuzzy search limit to control cleanup operations and query execution, allowing for more efficient handling of large result sets and minimizing fluctuations in response time