Search Postgresql Archives

Re: SELECTing every Nth record for better performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 3, 2009 at 9:26 PM, Tom <tom@xxxxxxxxxxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux