pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Alexander Korotkov <akorotkov@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Implement operator class parameters
Date: Mon, 30 Mar 2020 11:36:14 -0700
Message-ID: <20200330183614.qrfi7zipcqiztpti@alap3.anarazel.de> (raw)
In-Reply-To: <E1jIx6n-0002De-QB@gemulon.postgresql.org>
References: <E1jIx6n-0002De-QB@gemulon.postgresql.org>

Hi,

On 2020-03-30 16:17:53 +0000, Alexander Korotkov wrote:
> Implement operator class parameters
> 
> PostgreSQL provides set of template index access methods, where opclasses have
> much freedom in the semantics of indexing.  These index AMs are GiST, GIN,
> SP-GiST and BRIN.  There opclasses define representation of keys, operations on
> them and supported search strategies.  So, it's natural that opclasses may be
> faced some tradeoffs, which require user-side decision.  This commit implements
> opclass parameters allowing users to set some values, which tell opclass how to
> index the particular dataset.
> 
> This commit doesn't introduce new storage in system catalog.  Instead it uses
> pg_attribute.attoptions, which is used for table column storage options but
> unused for index attributes.
> 
> In order to evade changing signature of each opclass support function, we
> implement unified way to pass options to opclass support functions.  Options
> are set to fn_expr as the constant bytea expression.  It's possible due to the
> fact that opclass support functions are executed outside of expressions, so
> fn_expr is unused for them.
> 
> This commit comes with some examples of opclass options usage.  We parametrize
> signature length in GiST.  That applies to multiple opclasses: tsvector_ops,
> gist__intbig_ops, gist_ltree_ops, gist__ltree_ops, gist_trgm_ops and
> gist_hstore_ops.  Also we parametrize maximum number of integer ranges for
> gist__int_ops.  However, the main future usage of this feature is expected
> to be json, where users would be able to specify which way to index particular
> json parts.
> 
> Catversion is bumped.
> 
> Discussion: https://postgr.es/m/d22c3a18-31c7-1879-fc11-4c1ce2f5e5af%40postgrespro.ru
> Author: Nikita Glukhov, revised by me
> Reviwed-by: Nikolay Shaplov, Robert Haas, Tom Lane, Tomas Vondra, Alvaro Herrera

This triggers a few new (harmless) warnings for me:
In file included from /home/andres/src/postgresql/src/include/postgres.h:46,
                 from /home/andres/src/postgresql/src/backend/access/index/indexam.c:44:
/home/andres/src/postgresql/src/backend/access/index/indexam.c: In function ‘index_getprocid’:
/home/andres/src/postgresql/src/backend/access/index/indexam.c:782:17: warning: comparison is always true due to limited range of data type [-Wtype-limits]
  782 |  Assert(procnum >= 0 && procnum <= (uint16) nproc);
      |                 ^~
/home/andres/src/postgresql/src/backend/access/index/indexam.c:782:2: note: in expansion of macro ‘Assert’
  782 |  Assert(procnum >= 0 && procnum <= (uint16) nproc);
      |  ^~~~~~
/home/andres/src/postgresql/src/backend/access/index/indexam.c: In function ‘index_getprocinfo’:
/home/andres/src/postgresql/src/backend/access/index/indexam.c:818:17: warning: comparison is always true due to limited range of data type [-Wtype-limits]
  818 |  Assert(procnum >= 0 && procnum <= (uint16) nproc);
      |                 ^~
/home/andres/src/postgresql/src/include/c.h:782:9: note: in definition of macro ‘Assert’
  782 |   if (!(condition)) \
      |         ^~~~~~~~~
PostgreSQL installation complete.

Greetings,

Andres Freund





view thread (4+ messages)  latest in thread

Message-ID: <20200330183614.qrfi7zipcqiztpti@alap3.anarazel.de>
Permalink:  ../20200330183614.qrfi7zipcqiztpti@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20200330183614.qrfi7zipcqiztpti@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, akorotkov@postgresql.org
  Subject: Re: pgsql: Implement operator class parameters
  In-Reply-To: <20200330183614.qrfi7zipcqiztpti@alap3.anarazel.de>
  References: <E1jIx6n-0002De-QB@gemulon.postgresql.org> <20200330183614.qrfi7zipcqiztpti@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox