pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Chantal Ackermann <chantal.ackermann@biomax.de>
To: pgsql-performance@postgresql.org
Subject: Re: cost and actual time
Date: Thu, 13 Feb 2003 12:08:22 -0800
Message-ID: <web-2838434@davinci.ethosmedia.com> (raw)
In-Reply-To: <3E4BDE8B.5040908@biomax.de>

Chantal, 

> Sort Key: disease.disease_name, disease_occurrences.sentence_id
> ->  Nested Loop  (cost=0.00..6922.38 rows=98 width=64) (actual
> time=61.49..275047.46 rows=18910 loops=1)
>   ->  Nested Loop  (cost=0.00..6333.23 rows=98 width=28) (actual 
> time=61.42..274313.87 rows=18910 loops=1)
>     ->  Nested Loop  (cost=0.00..5894.04 rows=64 width=16) (actual 
> time=32.00..120617.26 rows=46849 loops=1)
> 
> I tried to tweak the conf settings, but I think I already reached
> quite a good value concerning shared buffers and sort mem. the
> database is vacuum full analyzed. indexes seem fine.

You *sure* that you've vacuum analyzed recently?   The planner above is
choosing a bad plan because its row estimates are way off ... if the
subquery was actually returning 98 rows, the plan above would make
sense ... but with 18,000 rows being returned, a Nested Loop is
suicidal.

Perhaps you could post the full text of the query?  If some of your
criteria are coming from volatile functions, then that could explain
why the planner is so far off ...

-Josh Berkus



view thread (11+ messages)  latest in thread

Message-ID: <web-2838434@davinci.ethosmedia.com>
Permalink:  ../web-2838434@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-2838434@davinci.ethosmedia.com

 · 

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: josh@agliodbs.com, chantal.ackermann@biomax.de
  Subject: Re: cost and actual time
  In-Reply-To: <web-2838434@davinci.ethosmedia.com>
  References: <3E4BDE8B.5040908@biomax.de> <web-2838434@davinci.ethosmedia.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