Re: Need more speed from this.

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Brian Avis <brian(dot)avis(at)searhc(dot)org>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Need more speed from this.
Date: 2001-11-19 21:39:07
Message-ID: 20011119133815.P49177-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 19 Nov 2001, Brian Avis wrote:

> | server_id | date | time | data_type_id | data |
> |___________|________|________|______________|______|
> | | | | | |
> | 26 | a date | a time | 8 | 98 |
> | | | | | |
> -----------------------------------------------------
>
>
> This table is indexed on server_id and data_type_id.
>
> It currently has about 674,456 rows and is growing on a daily
> basis.
>
> The problem is that selects from this table are really slow.
>
> For instance if I do this.
>
> SELECT AVG(data) FROM system_data
> WHERE date BETWEEN CAST('2001-02-01' AS DATE)
> AND CAST ('2001-02-28' AS DATE)
> AND
> server_id = 26
> AND
> data_type_id = 8;
>
> It will take several seconds to complete this select.

Let's go through the usual. Have you used vacuum analyze
recently and what does explain show for the query?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-11-19 21:39:44 Re: [HACKERS] bug or change in functionality in 7.2?
Previous Message hubert depesz lubaczewski 2001-11-19 21:30:35 explanation about buffers and memory usage ... ?