pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Using ctid column changes plan drastically
Date: Tue, 24 Jul 2012 13:12:46 -0400
Message-ID: <24101.1343149966@sss.pgh.pa.us> (raw)
In-Reply-To: <jumim1$nq7$1@dough.gmane.org>
References: <julsfr$otg$1@dough.gmane.org>
	<21308.1343139781@sss.pgh.pa.us>
	<jumcuv$26n$1@dough.gmane.org>
	<22819.1343145325@sss.pgh.pa.us>
	<jumim1$nq7$1@dough.gmane.org>

Thomas Kellerer <spam_eater@gmx.net> writes:
> Tom Lane wrote on 24.07.2012 17:55:
>> FWIW, it might be helpful to cast this as a NOT EXISTS rather than
>> NOT IN subquery.

> Hmm. How would you change that into an NOT EXISTS clause (so that one of the duplicates remains)
> Everything I come up with is in fact slower than the NOT IN solution.

Well, it would only help if you're running a PG version that's new
enough to recognize the NOT EXISTS as an anti-join; and even then,
it's possible that joining on a tid column forecloses enough plan
types that you don't get any real benefit.  But I'm just guessing.
Can you show exactly what you tried and what EXPLAIN ANALYZE results
you got?

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <24101.1343149966@sss.pgh.pa.us>
Permalink:  ../24101.1343149966@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24101.1343149966@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, spam_eater@gmx.net
  Subject: Re: Using ctid column changes plan drastically
  In-Reply-To: <24101.1343149966@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