SQL speedup on timestamp filtering

Started by Jean-Christophe ARNUover 22 years ago1 messagesgeneral
Jump to latest
#1Jean-Christophe ARNU
arnu@paratronic.fr

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