pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ken@scottshill.com
Cc: Markus Schaber <schabi@logix-tt.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Non Matching Records in Two Tables
Date: Tue, 14 Feb 2006 16:07:29 -0500
Message-ID: <22658.1139951249@sss.pgh.pa.us> (raw)
In-Reply-To: <1139950507.3083.64.camel@localhost.localdomain>
References: <1139433024.2044.48.camel@localhost.localdomain>
	<43EA6333.7050604@logix-tt.com>
	<1139950507.3083.64.camel@localhost.localdomain>

Ken Hill <ken@scottshill.com> writes:
>  Seq Scan on ncccr10  (cost=0.00..20417160510.08 rows=305782 width=104)
>    Filter: (NOT (subplan))
>    SubPlan
>      ->  Seq Scan on ncccr9  (cost=0.00..65533.71 rows=494471 width=104)
> (4 rows)

> Any ideas why it is so slow?

"NOT (subplan)" is horrendous (and the system knows it, note the huge
cost estimate).  Try increasing work_mem enough so you get a hashed
subplan instead.

			regards, tom lane



view thread (15+ messages)  latest in thread

Message-ID: <22658.1139951249@sss.pgh.pa.us>
Permalink:  ../22658.1139951249@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22658.1139951249@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-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ken@scottshill.com, schabi@logix-tt.com
  Subject: Re: Non Matching Records in Two Tables
  In-Reply-To: <22658.1139951249@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