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

Re: Subquery WHERE IN or WHERE EXISTS faster?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ulrich <ulrich(dot)mierendorff(at)gmx(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Subquery WHERE IN or WHERE EXISTS faster?
Date: 2008-06-28 15:53:43
Message-ID: 29009.1214668423@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Ulrich <ulrich(dot)mierendorff(at)gmx(dot)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.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Moritz OnkenDate: 2008-06-28 16:24:42
Subject: Planner should use index on a LIKE 'foo%' query
Previous:From: UlrichDate: 2008-06-28 15:22:41
Subject: Subquery WHERE IN or WHERE EXISTS faster?

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