Re: optimizing selects on time-series data in Pg

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Aditya <aditya(at)grot(dot)org>
Cc: sfpug(at)postgresql(dot)org
Subject: Re: optimizing selects on time-series data in Pg
Date: 2003-08-01 17:33:42
Message-ID: 200308011033.42917.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: sfpug

Aidtya,

> Here's what I did:
>
> - I did a vacuum
>
> - did a select count(*) for a few different virtualhosts to see how many
> rows were being dealt with
>
> - run explain analyze on each of those select count(*) and noted the
> difference, ie. the planner decided that a select on a virtual host with
> many more rows was better served by sequential scan than index scan

From the look of it, the database is doing the best it can on your hardware
and current tuning setup. I don't think you can speed this up on the SQL
side, unless you implement an aggregate caching scheme.

It's possible that you could move the break point btw. seq scan and index scan
slightly by increasing shared_buffers and effective_cache_size. What are
those variables now? And what's your hardware?

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse sfpug by date

  From Date Subject
Next Message Aditya 2003-08-01 17:51:48 Re: optimizing selects on time-series data in Pg
Previous Message Aditya 2003-08-01 17:13:39 Re: optimizing selects on time-series data in Pg