pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
To: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: Query too slow
Date: Mon, 25 Aug 2003 22:05:05 +0530
Message-ID: <3F4A8811.17912.54E46A0@localhost> (raw)
In-Reply-To: <20030825083343.H90125-100000@megazone.bigpanda.com>
References: <1061823792.3f4a253015fdc@sistemica.info>

On 25 Aug 2003 at 8:44, Stephan Szabo wrote:

> 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;?

In addition to that if it is getting the stats wrong, does running vacuum 
analyze help? If stats are updated, it should pick up proper plans, right?

Bye
 Shridhar

--
Flon's Law:	There is not now, and never will be, a language in	which it is the 
least bit difficult to write bad programs.




view thread (8+ messages)  latest in thread

Message-ID: <3F4A8811.17912.54E46A0@localhost>
Permalink:  ../3F4A8811.17912.54E46A0@localhost/
Also on:    postgresql.org/message-id/3F4A8811.17912.54E46A0@localhost

 · 

reply

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: shridhar_daithankar@persistent.co.in
  Subject: Re: Query too slow
  In-Reply-To: <3F4A8811.17912.54E46A0@localhost>
  References: <1061823792.3f4a253015fdc@sistemica.info> <3F4A8811.17912.54E46A0@localhost>

* 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