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 1l0HbY-0000Bi-Nj for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Jan 2021 05:25:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l0HbX-0000HZ-KR for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Jan 2021 05:24:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l0HbX-0000HS-DG for pgsql-hackers@lists.postgresql.org; Fri, 15 Jan 2021 05:24:59 +0000 Received: from wforward1-smtp.messagingengine.com ([64.147.123.30]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l0HbS-0005jA-4R for pgsql-hackers@postgresql.org; Fri, 15 Jan 2021 05:24:58 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailforward.west.internal (Postfix) with ESMTP id ED5C01364; Fri, 15 Jan 2021 00:24:48 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 15 Jan 2021 00:24:49 -0500 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=fm1; bh=Xa2K7wwpTTfd93OSckVzgmzrnGuBWfG0Y1Lq0RIPr nk=; b=FlIEn38VtezDoe1AFLauRidVZe7kiXm2aTpT/dfkUoJeJT1oDCw8G7QcV aZsTeTNSoNVrYvq4Vua5xIlxVQX3iE2w2KgnbhqWl4mGXbxeDorZZ939FXfqak0K jm+//Z9zgPMnWCkaKGrK4gj7Z3dIP7LoIvc78B1XrbcN8fl9zZ5+8SXPwHpnM+RB 9E5TN4fL/oN9ymjFqkf1ycejyhuh6jJfo896kPSoEHp/USHX6bSYLJ1VCMQ3IXIp HzLUn92hNQp0YtM44wj7F1gPgekfu4VMsEUUYOnco2mzcGL+6oZzce+aHe0Fi0rK XdaTU5TigBgh8xLAPkwGNC3EPcv6A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtddugdekfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhfhokffffgggjggtgfesthejredttdefjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvg hrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepfeeggfdtjeelvefhffev gefhjeduvedtheekudegjeelfeeiffffveegtedttefgnecuffhomhgrihhnpehpohhsth hgrhgvshhqlhdrohhrghenucfkphepkeejrddujeejrdejvddrudegvdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvg hnthhrrghuthesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: from april.pezone.net (p57b1488e.dip0.t-ipconnect.de [87.177.72.142]) by mail.messagingengine.com (Postfix) with ESMTPA id 24BB8240057; Fri, 15 Jan 2021 00:24:45 -0500 (EST) Subject: Re: Yet another fast GiST build To: Heikki Linnakangas , Andrey Borodin , Peter Geoghegan References: <7d9158ca-d7cb-88f0-dbbd-1d5cec32b1ae@iki.fi> <123F5F32-9A85-4D0B-9C7A-1686E6BBE15D@yandex-team.ru> <85df399a-e8a4-2369-f723-fd1a3a872575@iki.fi> <884200.1600634472@sss.pgh.pa.us> <891385.1600636205@sss.pgh.pa.us> <20200920224446.GF30557@telsasoft.com> <896113.1600643169@sss.pgh.pa.us> <8269ca22-d275-0afe-633c-2342c7ba11e6@iki.fi> <47CD54A6-EE59-433A-96E2-6F4E5973CEF4@yandex-team.ru> <422beff9-0e01-9ce6-edb9-c2a2289e8eb9@iki.fi> <0A1DDF47-CAB7-4D6A-9677-B1800FFB6984@yandex-team.ru> <4D68C21F-9FB9-41DA-B663-FDFC8D143788@yandex-team.ru> <4098005f-e4b5-5904-4b33-335dd106c132@iki.fi> <059BD785-A6CE-4E34-B80B-38E9E0309B78@yandex-team.ru> <8ACF61CC-32ED-4B4B-A2BC-15264E02D24E@yandex-team.ru> <3E4F9093-A1B5-4DF8-A292-0B48692E3954@yandex-team.ru> Cc: Tom Lane , Justin Pryzby , =?UTF-8?Q?Darafei_Kom=d1=8fpa_Praliaskouski?= , Pavel Borisov , Thomas Munro , Michael Paquier , Alexander Korotkov , PostgreSQL Hackers From: Peter Eisentraut Organization: EnterpriseDB Message-ID: <5b3d72ba-2522-5706-49ba-70dd90c69d3c@enterprisedb.com> Date: Fri, 15 Jan 2021 06:24:42 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2021-01-12 14:49, Heikki Linnakangas wrote: >>>> I suggest calling BuildIndexValueDescription() from your own custom >>>> debug instrumentation code. >>> Thanks for the hint, Peter! >>> This function does exactly what I want to do. But I have no Relation inside gist_page_items(bytea) function... probably, I'll add gist_page_items(relname, blockno) overload to fetch keys. >> >> PFA patch with implementation. > > I did a bit of cleanup on the function signature. The .sql script > claimed that gist_page_items() took bytea as argument, but in reality it > was a relation name, as text. I changed it so that it takes a page image > as argument, instead of reading the block straight from the index. > Mainly to make it consistent with brin_page_items(), if it wasn't for > that precedence I might've gone either way on it. I noticed this patch while working on another patch for pageinspect [0], and this one appears to introduce a problem similar to the one the other patch attempts to fix: The "itemlen" output parameters are declared to be of type smallint, but the underlying C data is of type uint16 (OffsetNumber). I don't know the details of gist enough to determine whether overflow is possible here. If not, perhaps a check or at least a comment would be useful. Otherwise, these parameters should be of type int in SQL. [0]: https://www.postgresql.org/message-id/09e2dd82-4eb6-bba1-271a-d2b58bf6c71f@enterprisedb.com