Re: Proposal: temporal extension "period" data type

From: Dimitri Fontaine <dim(at)hi-media(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: temporal extension "period" data type
Date: 2008-05-26 21:00:11
Message-ID: E316F9C9-499C-4C51-A283-4999ED636832@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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-----

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2008-05-26 22:02:59 Re: Updated patch (Re: [PATCHES] WITH RECURSIVE patch V0.1)
Previous Message Simon Riggs 2008-05-26 20:39:05 Re: Read Uncommitted