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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-performance by date

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