Re: Need more speed from this. - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Need more speed from this.
Date
Msg-id 20011119133815.P49177-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Need more speed from this.  (Brian Avis <brian.avis@searhc.org>)
List 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?



pgsql-general by date:

Previous
From: Peter Pilsl
Date:
Subject: Re: cant alter/create tables via odbc
Next
From: Bruce Momjian
Date:
Subject: Re: explanation about buffers and memory usage ... ?