Re: GiST for range types (was Re: Range Types - typo + NULL string constructor)

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: GiST for range types (was Re: Range Types - typo + NULL string constructor)
Date: 2011-10-24 11:05:15
Message-ID: CAPpHfduORTpMLB=Lxi5eDEjx8mfvy2g7=wKyN83iXxKHW0P3+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

On Mon, Oct 17, 2011 at 12:38 PM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:

> > I started implementing subtype_diff, and I noticed that it requires
> > defining an extra function for each range type. Previously, the numeric
> > types could just use a cast, which was convenient for user-defined range
> > types.
> >
> > If you have any other ideas to make that cleaner, please let me know.
> > Otherwise I'll just finish implementing subtype_diff.
>
I think implementing subtype_diff for each datatype is ok. We could
implement some universal function based on minus operator and casting to
double precision. But such solution might be unacceptable in both
*predictability
(operator and casting function might do not the things we expect) and
performance.*

I'm beginning to think that we should just allow the user to specify
> their own gist_penalty function. Specifying just the subtype_diff
> doesn't save much time, and it can only be limiting. Additionally, it's
> harder for users to understand the purpose of the function.
>
If we allow user to specify own gist_penalty function, then such function
should deal with:
1) GiST-specific data structures such as GISTENTRY.
2) Decomposing ranges using range_deserialize.
3) Inifinities, which we could handle in general penalty functions.
Thats why I prefere to implement subtype_diff.

------
With best regards,
Alexander Korotkov.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2011-10-24 11:25:05 Re: TABLE tab completion
Previous Message Heikki Linnakangas 2011-10-24 10:40:53 Re: Separating bgwriter and checkpointer