From: Andy <frum@ar-sd.net>
To: pgsql-performance@postgresql.org
Subject: Re: Improving Inner Join Performance
Date: Fri, 6 Jan 2006 11:21:31 +0200
Message-ID: <007f01c612a2$94b1a5b0$0b00a8c0@forge> (raw)
References: <001d01c6120b$0d783600$0b00a8c0@forge>
<20060105132006.19c7cd31.frank@wiles.org>
Yes I have indexes an all join fields.
The tables have around 30 columns each and around 100k rows.
The database is vacuumed every hour.
Andy.
----- Original Message -----
From: "Frank Wiles" <frank@wiles.org>
To: "Andy" <frum@ar-sd.net>
Cc: <pgsql-performance@postgresql.org>
Sent: Thursday, January 05, 2006 9:20 PM
Subject: Re: [PERFORM] Improving Inner Join Performance
> On Thu, 5 Jan 2006 17:16:47 +0200
> "Andy" <frum@ar-sd.net> wrote:
>
>> Hi to all,
>>
>> I have the following query:
>>
>> SELECT count(*) FROM orders o
>> INNER JOIN report r ON r.id_order=o.id
>> WHERE o.id_status>3
>
>> How can I improve this query's performace?? The ideea is to count all
>> the values that I have in the database for the following conditions.
>> If the users puts in some other search fields on the where then the
>> query runs faster but in this format sometimes it takes a lot lot of
>> time(sometimes even 2,3 seconds).
>>
>> Can this be tuned somehow???
>
> Do you have an index on report.id_order ? Try creating an index for
> it if not and run a vacuum analyze on the table to see if it gets
> rid of the sequence scan in the plan.
>
> ---------------------------------
> Frank Wiles <frank@wiles.org>
> http://www.wiles.org
> ---------------------------------
>
>
>
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-performance@postgresql.org
Cc: frum@ar-sd.net
Subject: Re: Improving Inner Join Performance
In-Reply-To: <007f01c612a2$94b1a5b0$0b00a8c0@forge>
* 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