pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: emre@hasegeli.com, PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: btree_gin and btree_gist for enums
Date: Sat, 05 Nov 2016 13:13:29 -0400
Message-ID: <31412.1478366009@sss.pgh.pa.us> (raw)
In-Reply-To: <e60f50c4-899a-d48a-6cb4-4611acf2f73c@dunslane.net>
References: <56EA8A71.8060107@dunslane.net>
	<56EACB8C.1040406@dunslane.net>
	<CAE2gYzyB=vyquQ2hEWA9UwNb=zYAKFsNO5vBtbfkV2=PzoPZjg@mail.gmail.com>
	<03f7d748-0f89-e8e1-094d-f04e1026b93d@dunslane.net>
	<27220.1478360811@sss.pgh.pa.us>
	<e60f50c4-899a-d48a-6cb4-4611acf2f73c@dunslane.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Andrew Dunstan <andrew@dunslane.net> writes:
> On 11/05/2016 11:46 AM, Tom Lane wrote:
>> That may be a good fix for robustness purposes, but it seems pretty horrid
>> from an efficiency standpoint.  Where is this call, and should we be
>> modifying it to provide a flinfo?

> I thought of providing an flinfo, but I couldn't see a simple way to do 
> it that would provide something much longer lived than the function 
> call, in which case it seemed a bit pointless. That's why I asked for 
> assistance :-)

Hmm.  The problem is that the intermediate layer in btree_gist (and
probably btree_gin too, didn't look) does not pass through the
FunctionCallInfo data structure that's provided by the GIST AM.
That wasn't needed up to now, because none of the supported data types
are complex enough that any cached state would be useful, but trying
to extend it to enums exposes the shortcoming.

We could fix this, but it would be pretty invasive since it would require
touching just about every function in btree_gist/gin.  Not entirely sure
that it's worth it.  On the other hand, the problem might well come up
again in future, perhaps for a datatype where the penalty for lack of
a cache is greater --- eg, it would be pretty painful to support
record_cmp without caching.  And the changes ought to be relatively
mechanical, even if they are extensive.

BTW, this patch would be a great deal shorter if you made use of the
work done in 40b449ae8.  That is, you no longer need to replace the
base extension script --- just add an update script and change the
default version in the .control file.  See fd321a1df for an example.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (39+ messages)  latest in thread

Message-ID: <31412.1478366009@sss.pgh.pa.us>
Permalink:  ../31412.1478366009@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/31412.1478366009@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, andrew@dunslane.net
  Subject: Re: btree_gin and btree_gist for enums
  In-Reply-To: <31412.1478366009@sss.pgh.pa.us>

* 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