Re: Select very slow... - Mailing list pgsql-sql

From David Olbersen
Subject Re: Select very slow...
Date
Msg-id Pine.LNX.4.31.0103181038160.27741-100000@bubbles.electricutopia.net
Whole thread Raw
In response to Select very slow...  ("Fernando Eduardo B. L. e Carvalho" <feblec@ig.com.br>)
List pgsql-sql
On Sun, 18 Mar 2001, Fernando Eduardo B. L. e Carvalho wrote:

>   select  p.city,count(*) from sales s, person p where s.doc = p.doc
> group by p.city;
>
>    Anyone help-me?

1: VACUUM ANALYZE sales  VACUUM ANALYZE person;

2: That 'count(*)' is going to be slow.  Try counting a column that's indexed (p.doc might work?)

3: EXPLAIN <your select from above>;  That should give you some hints on what to optimize.

-- Dave



pgsql-sql by date:

Previous
From: "Fernando Eduardo B. L. e Carvalho"
Date:
Subject: Select very slow...
Next
From: Tom Lane
Date:
Subject: Re: update table sequence