From: David Olbersen <dave@slickness.org>
To: Fernando Eduardo B. L. e Carvalho <feblec@ig.com.br>
Cc: Postgresql <pgsql-sql@postgresql.org>
Subject: Re: Select very slow...
Date: Sun, 18 Mar 2001 10:42:57 -0800 (PST)
Message-ID: <Pine.LNX.4.31.0103181038160.27741-100000@bubbles.electricutopia.net> (raw)
In-Reply-To: <3AB47CBE.B3D44367@ig.com.br>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dave@slickness.org, feblec@ig.com.br
Subject: Re: Select very slow...
In-Reply-To: <Pine.LNX.4.31.0103181038160.27741-100000@bubbles.electricutopia.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox