pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jaime Casanova <jcasanov@systemguards.com.ec>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ulrich <ulrich.mierendorff@gmx.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Subquery WHERE IN or WHERE EXISTS faster?
Date: Sun, 29 Jun 2008 23:33:57 -0500
Message-ID: <3073cc9b0806292133l397f0d8etef06b5bb3aba13ae@mail.gmail.com> (raw)
In-Reply-To: <29009.1214668423@sss.pgh.pa.us>
References: <48665741.2060900@gmx.net>
	<29009.1214668423@sss.pgh.pa.us>

On Sat, Jun 28, 2008 at 10:53 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Ulrich <ulrich.mierendorff@gmx.net> writes:
>> People say that [EXISTS is faster]
>
> People who say that are not reliable authorities, at least as far as
> Postgres is concerned.  But it is always a bad idea to extrapolate
> results on toy tables to large tables --- quite aside from measurement
> noise and caching issues, the planner might pick a different plan when
> faced with large tables.  Load up a realistic amount of data and then
> see what you get.
>

i've made some queries run faster using EXISTS instead of large IN
clauses... actually, it was NOT EXISTS replacing a NOT IN

while i'm not telling EXISTS is better i actually know in some cases is better

-- 
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Guayaquil - Ecuador
Cel. (593) 87171157



view thread (13+ messages)  latest in thread

Message-ID: <3073cc9b0806292133l397f0d8etef06b5bb3aba13ae@mail.gmail.com>
Permalink:  ../3073cc9b0806292133l397f0d8etef06b5bb3aba13ae@mail.gmail.com/
Also on:    postgresql.org/message-id/3073cc9b0806292133l397f0d8etef06b5bb3aba13ae@mail.gmail.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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jcasanov@systemguards.com.ec, tgl@sss.pgh.pa.us, ulrich.mierendorff@gmx.net
  Subject: Re: Subquery WHERE IN or WHERE EXISTS faster?
  In-Reply-To: <3073cc9b0806292133l397f0d8etef06b5bb3aba13ae@mail.gmail.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