Re: Proposal: temporal extension "period" data type - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Proposal: temporal extension "period" data type
Date
Msg-id E316F9C9-499C-4C51-A283-4999ED636832@hi-media.com
Whole thread Raw
In response to Re: Proposal: temporal extension "period" data type  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Le 26 mai 08 à 20:36, Jeff Davis a écrit :
>> Instead of one datatype, I'd like to see the capability of defining
>> period types based on any datatype with suitable opclass. Periods of
>> dates and floats, for example, would be just as useful as periods of
>> timestamps.
>
> I agree, although we couldn't use the word "period" to describe floats
> (at least, that's not how I understand the word).

In order to get a good enough implementation of text based prefix
searches (where prefix_column @> 'literal') I coded a prefix_range
datatype, which would be the text period here...  http://pgfoundry.org/projects/prefix

So I'd propose "range" as the generic "period" name, and let's extend
it to text too.
And while at it maybe we could index suffix searches in addition to
prefix searches...

Some tests show that even without specific index support, prefix @>
text is quicker than text like 'prefix%', so maybe it would be
possible to have some generic way to use ranges under the hood to
speed-up some specific queries...
Applied to timestamps and "period", this would allow using period
contains operator for handling between, e.g. Dunno if this part is a
good idea, but I nevertheless felt like raising it.

HTH,
- --
dim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkg7JNsACgkQZnqmTbDljfBGFgCeJ43Q4XQPPl/mEX+AuJmGeMs+
e0sAnR1eD5/B6J+8VADK4Vuj3USXdZuv
=WhNz
-----END PGP SIGNATURE-----


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Read Uncommitted
Next
From: David Fetter
Date:
Subject: Re: Updated patch (Re: [PATCHES] WITH RECURSIVE patch V0.1)