Re: Range Types and length function - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Range Types and length function
Date
Msg-id BANLkTineSD6D3R+dUiz5iiTE75+NUNAn7A@mail.gmail.com
Whole thread Raw
In response to Range Types and length function  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Range Types and length function
List pgsql-hackers
On Sun, Jun 26, 2011 at 8:18 AM, Jeff Davis <pgsql@j-davis.com> wrote:
>  * it needs to know the result type of that function, which might not be
> the subtype (for instance, for timestamp the difference type would be
> interval)

What's the use case for the length() function? Is it for users to be
able to display useful information about their ranges? Or is it for
implementing things like GIST indexes?

For the latter a length function that always returns a float might be
more useful. Even if it isn't guaranteed to always be perfectly
precise, that is if ranges of similar length sometimes returned
identical values, at least it could be used for things like penalty().


--
greg


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: WIP: Fast GiST index build
Next
From: Heikki Linnakangas
Date:
Subject: Re: Repeated PredicateLockRelation calls during seqscan