pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Creager <Robert_Creager@LogicalChaos.org>
Cc: PGPerformance <pgsql-performance@postgresql.org>
Subject: Re: This query is still running after 10 hours...
Date: Tue, 28 Sep 2004 11:04:23 -0400
Message-ID: <14842.1096383863@sss.pgh.pa.us> (raw)
In-Reply-To: <20040928081957.7a317a95@thunder.mshome.net>
References: <20040928081957.7a317a95@thunder.mshome.net>

Robert Creager <Robert_Creager@LogicalChaos.org> writes:
> Normally, this query takes from 5 minutes to 2 hours to run.  On this update, it's been running for more than 10 hours.

> ...
>         ->  Nested Loop  (cost=250.69..129094.19 rows=77211 width=59)
>               ->  Hash Join  (cost=250.69..307.34 rows=67 width=12)
>                     Hash Cond: ("outer".pair_id = "inner".pair_id)
> ...

It chose a nested loop here because it was only expecting 67 rows out of
the next-lower join, and so it thought it would only need 67 repetitions
of the index probe into obs_v_file_id_index.  I'm suspicious that that
estimate was way low and so the nestloop is taking forever.  You might
try "SET enable_nestloop = off" as a crude way of avoiding that trap.

			regards, tom lane



view thread (10+ messages)  latest in thread

Message-ID: <14842.1096383863@sss.pgh.pa.us>
Permalink:  ../14842.1096383863@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14842.1096383863@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Robert_Creager@LogicalChaos.org
  Subject: Re: This query is still running after 10 hours...
  In-Reply-To: <14842.1096383863@sss.pgh.pa.us>

* 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