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

From Jeff Davis
Subject Re: GiST for range types (was Re: Range Types - typo + NULL string constructor)
Date
Msg-id 1318091273.1724.89.camel@jdavis
Whole thread Raw
In response to Re: GiST for range types (was Re: Range Types - typo + NULL string constructor)  (Alexander Korotkov <aekorotkov@gmail.com>)
List pgsql-hackers
On Sat, 2011-10-08 at 18:43 +0400, Alexander Korotkov wrote:

> I meant that penalty can be determined as sum of difference of old and
> new bounds of range, i.e. penalty = subtype_diff_float(new_lower,
> old_lower) + subtype_diff_float(old_upper, new_upper). 
> When we insert [100,200) into [10,+inf), union([100,200), [10,+inf))
> = [10,+inf), so penalty =  subtype_diff_float(10,10)
> +  subtype_diff_float(+inf, +inf) = 0 + 0 = 0.
> When we insert [100,200) into [100000,), union([100,200), [100000,
> +inf)) = [100,+inf), so penalty =  subtype_diff_float(100,100000)
> +  subtype_diff_float(+inf, +inf) = 99900 + 0 = 99900.
> 
OK, I like that. I will make the change.

> But, there are still the problem, when we'are inserting open interval
> when there is no such open intervals yet. For example, we're going to
> insert [0,+inf), while root page contains [0,10), [10,20), [20,30).
> Each penalty will be infinity, while it seems to be better to insert
> it into [0,10). But, it seems to me to be general limitation of
> current GiST interface, when we have to express penalty in a single
> float.

That seems like an acceptable limitation. I don't think my solution
handles it any better.

Regards,Jeff Davis

> 




pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: [v9.2] Fix Leaky View Problem
Next
From: Tom Lane
Date:
Subject: Re: SET variable - Permission issues