Skip site navigation (1) Skip section navigation (2)

Re: Using ctid column changes plan drastically

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Using ctid column changes plan drastically
Date: 2012-07-24 17:12:46
Message-ID: 24101.1343149966@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Thomas Kellerer <spam_eater(at)gmx(dot)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

In response to

Responses

pgsql-performance by date

Next:From: Richard HuxtonDate: 2012-07-24 17:21:38
Subject: Re: transactions start time
Previous:From: Thomas KellererDate: 2012-07-24 16:32:09
Subject: Re: Using ctid column changes plan drastically

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group