Re: 4s query want to run faster - Mailing list pgsql-performance

From Scott Marlowe
Subject Re: 4s query want to run faster
Date
Msg-id dcc563d10802211258w65285c0bl9f9da18b9ed0fa92@mail.gmail.com
Whole thread Raw
In response to 4s query want to run faster  ("Adonias Malosso" <malosso@gmail.com>)
Responses Re: 4s query want to run faster
List pgsql-performance
On Thu, Feb 21, 2008 at 2:48 PM, Adonias Malosso <malosso@gmail.com> wrote:
> Hi all,
>
> The following query takes about 4s to run in a 16GB ram server. Any ideas
> why it doesn´t use index for the primary keys in the join conditions?
>
> select i.inuid, count(*) as total
> from cte.instrumentounidade i
>  inner join cte.pontuacao p on p.inuid = i.inuid
> inner join cte.acaoindicador ai on ai.ptoid = p.ptoid
> inner join cte.subacaoindicador si on si.aciid = ai.aciid
> where i.itrid = 2 and p.ptostatus = 'A'
> group by i.inuid
>  having count(*) > 0

What does explain analyze say about that query?

pgsql-performance by date:

Previous
From: "Adonias Malosso"
Date:
Subject: 4s query want to run faster
Next
From: "Adonias Malosso"
Date:
Subject: Re: 4s query want to run faster