pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
To: Andrey Borodin <x4mmm@yandex-team.ru>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Darafei Komяpa Praliaskouski <me@komzpa.net>
Cc: Pavel Borisov <pashkin.elfe@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Yet another fast GiST build
Date: Fri, 15 Jan 2021 06:24:42 +0100
Message-ID: <5b3d72ba-2522-5706-49ba-70dd90c69d3c@enterprisedb.com> (raw)
In-Reply-To: <ea7d112f-755e-d194-1777-f10ca6f372b7@iki.fi>
References: <7d9158ca-d7cb-88f0-dbbd-1d5cec32b1ae@iki.fi>
	<123F5F32-9A85-4D0B-9C7A-1686E6BBE15D@yandex-team.ru>
	<85df399a-e8a4-2369-f723-fd1a3a872575@iki.fi>
	<!63596817-db40-1093-c6ce-5dea7dac67c4@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>
	<e1d41317-7420-b7ba-0d88-19625012e31e@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>
	<CAH2-WzkBwtk0Np0oZvpiywqjrVwZQtDHSjatJ54ofyezLBxzeQ@mail.gmail.com>
	<8ACF61CC-32ED-4B4B-A2BC-15264E02D24E@yandex-team.ru>
	<3E4F9093-A1B5-4DF8-A292-0B48692E3954@yandex-team.ru>
	<ea7d112f-755e-d194-1777-f10ca6f372b7@iki.fi>

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





view thread (111+ messages)  latest in thread

Message-ID: <5b3d72ba-2522-5706-49ba-70dd90c69d3c@enterprisedb.com>
Permalink:  ../5b3d72ba-2522-5706-49ba-70dd90c69d3c@enterprisedb.com/
Also on:    postgresql.org/message-id/5b3d72ba-2522-5706-49ba-70dd90c69d3c@enterprisedb.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: peter.eisentraut@enterprisedb.com, hlinnaka@iki.fi, x4mmm@yandex-team.ru, pg@bowt.ie, tgl@sss.pgh.pa.us, pryzby@telsasoft.com, me@komzpa.net, pashkin.elfe@gmail.com, thomas.munro@gmail.com, michael@paquier.xyz, a.korotkov@postgrespro.ru
  Subject: Re: Yet another fast GiST build
  In-Reply-To: <5b3d72ba-2522-5706-49ba-70dd90c69d3c@enterprisedb.com>

* 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