From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Rhaoni Chiu Pereira <rhaoni@sistemica.info>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: Query too slow
Date: Mon, 25 Aug 2003 08:44:43 -0700 (PDT)
Message-ID: <20030825083343.H90125-100000@megazone.bigpanda.com> (raw)
In-Reply-To: <1061823792.3f4a253015fdc@sistemica.info>
On Mon, 25 Aug 2003, Rhaoni Chiu Pereira wrote:
> Hi List,
>
> As I said before, I'm not a DBA " yet" , but I'm learning ... and I
> already have a PostgreSQL running, so I have to ask some help...
> I got a SQL as folows :
...
Looking at the explain:
It's choosing lots of nested loops because it's expecting a small number
of rows to be returned at each step but in reality there are alot of rows
so that's may not really be a good choice.
For example the scan of ftnfco00 is expected to return 295 rows but
actually returns 9339, and it looks like it's not estimating the number of
matches between the tables very well either since the real count gets up
to 240000 in a step where the estimated rows goes to 1.
What does explain analyze give after set enable_nestloop=off;?
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: sszabo@megazone.bigpanda.com, rhaoni@sistemica.info
Subject: Re: Query too slow
In-Reply-To: <20030825083343.H90125-100000@megazone.bigpanda.com>
References: <1061823792.3f4a253015fdc@sistemica.info> <20030825083343.H90125-100000@megazone.bigpanda.com>
* 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