On Thu, Dec 3, 2009 at 9:26 PM, Tom <tom@cstcomposites.com> wrote:
> I
> want run a query that skips every nth record and returns a managable
> dataset that still gives a correct overview of the data without
> slowing the programme down. Is there an easy way to do this that I
> have overlooked? I looked at:
I've played with datalogging. It was very easy to find nth records
when using date_trunc() on a timestamp. The only minor problem with
data_trunc was that I couldn't create arbitrary granularity. For
example it is easy to date_trunc() on an year, month, week, day, hour
or a minute but I wanted 5, 10 and 15 minute increments. I bet there
could be a solution to this, but I never looked into it.
To improve the select performance, I created functional indexes using
different data_trunc() granularities.
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug