Re: IN vs EXIIST

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: IN vs EXIIST
Date: 2002-09-19 11:04:53
Message-ID: 3D89AF55.4000107@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Henshall, Stuart - WCP wrote:
>
> AND invoice_li.invoice_id=sq_inv_li.invoice_id
> is the bit that tells it to check the id of the sub query and parent are
> the same.
> If you don't have this bit I believe it makes the subquery kind of
> piontless

You are right. I had "ordered" my data set in between running the
queries. When I added some new data running the EXISTS query without the
AND a.id=b.id bit the results were fast *and* wrong ;)

I'm still scratching my head as to why EXISTS isn't faster *and* why
EXPLAIN says it should be ...

Jc

Browse pgsql-general by date

  From Date Subject
Next Message Jan Weerts 2002-09-19 11:09:26 Re: IN vs EXIIST
Previous Message Jochem van Dieten 2002-09-19 10:59:55 Re: IN vs EXIIST