SQL speedup on timestamp filtering

From: Jean-Christophe ARNU (JX) <arnu(at)paratronic(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Subject: SQL speedup on timestamp filtering
Date: 2003-07-22 13:53:28
Message-ID: 20030722155328.1b467e75.arnu@paratronic.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there :)

I have a large table with (not only but important) timestamp and value
(double) columns.
I would like to "sample" data at given timestamps values (I have one value
each minute and I would like to get each 5 minutes value on a given timestamp
range) and get the corresponding values.

As I'm quite bad at SQL but is there a way with pg to get a timestamp modulo
an interval? Is there a way to optimize this (indexing in a different way,
designing database another way or writting stored procedure that would do the
job efficiently)?

Thanks in advance!

--
Jean-Christophe ARNU
Paratronic

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-07-22 14:05:02 Re: Postgres Database Error Codes and Error Messages
Previous Message Tom Lane 2003-07-22 13:37:57 Re: can anybody help me please