Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jIzH4-0002Gk-IE for pgsql-committers@arkaria.postgresql.org; Mon, 30 Mar 2020 18:36:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jIzH3-0006mG-H1 for pgsql-committers@arkaria.postgresql.org; Mon, 30 Mar 2020 18:36:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jIzH3-0006m6-Bh for pgsql-committers@lists.postgresql.org; Mon, 30 Mar 2020 18:36:37 +0000 Received: from [64.147.123.21] (helo=wout5-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jIzGu-0008F1-2u for pgsql-committers@lists.postgresql.org; Mon, 30 Mar 2020 18:36:35 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 8D1896D2; Mon, 30 Mar 2020 14:36:16 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 30 Mar 2020 14:36:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm1; bh=u 63J4Tsq110M58ZratBNJPCyMupUBeHeS+Mj8ap0Dzw=; b=HbiEWP+NaryOdR7hK S0qvS0BBxo53/prRYEgdhRSxo3E0D+yeIpI9YHeP3f6e/0veW9murcy5X4QOyh1g LrlUtIZvgZKbgncyVEjGXm1uXRGCXbaKVhvqEUqTNLBezzVkljUyRyfJSKC3rxV5 5KGEg2mnSricnw57rGwY2zeRifNKHPkTh+tJE2CdAcsTuDt3TqBUliKjAG2/JwMH ZWvrlpGIu35h2p5XzT6hOz7RWi6e2/vuAhduCz5P+zxC2iQsDfyvberDUTKEVjHx /PE9acudfRkzQlFqd3rA51o8v2ZdDQVH+2kxS87To3filFFMaxUqta2FPn+nmnzB dY4Gg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=u63J4Tsq110M58ZratBNJPCyMupUBeHeS+Mj8ap0D zw=; b=VU3kL6wLNiKPBNv6Iw7Yy5hzSawAtfMazA7RPRKweIBZ0MW7LL3VARX96 vU+mmPp1Cc26fGNpVhe/q2Qpqz//gy6yfdUt8wBDgU0Vo/W+LBMYLlIFesDWlWuq +cAuxbLKGuJYWN894xuOxxNimDi1JQogrxp8K10DChYAgR24X7ATW7E3IrKdkejl lbN7bub41vyl5hWt4f8Mj5inpTTfYo1ukoYcpDuEHUjdlng1WC65K8x0iiwZ0PUA iOE1tL//WJB3oOQKgzHJG12ImoIUTL8107F9IyRW5RiJiTg+XW0FSNScSuHoaw8X G6d5FPemB9kWQoliyqo8lhY6J6r3g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudeihedguddvjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetnhgu rhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucffoh hmrghinhepphhoshhtghhrrdgvshenucfkphepieejrdduiedtrddvudejrddvhedtnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvg hssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id C362D306C9C5; Mon, 30 Mar 2020 14:36:15 -0400 (EDT) Date: Mon, 30 Mar 2020 11:36:14 -0700 From: Andres Freund To: Alexander Korotkov Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Implement operator class parameters Message-ID: <20200330183614.qrfi7zipcqiztpti@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.21 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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