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

Re: Strange query plan

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Strange query plan
Date: 2001-06-05 15:02:00
Message-ID: Pine.GSO.4.33.0106051756490.26250-100000@ra.sai.msu.su (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, 5 Jun 2001, Tom Lane wrote:

> Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> writes:
> > should be
> > select msg_prt.tid as mid from msg_prt
> >  where exists (select idx.tid from idx where msg_prt.tid=idx.tid
> >                and idx.did=1 and ( idx.lid = 1207 or idx.lid=59587 ));
> > but this is not a big win.
>
> Shouldn't be any win at all: the IN expression-list notation will get
> translated to exactly that form.

Sure

>
> > Anyway, what's about original query ?
>
> IN/EXISTS subqueries suck.  This has been true for a long time and is
> going to be true for a while longer, unless someone else fixes it before
> I have a chance to look at it.  See if you can't rewrite your query as
> a plain join.
>

That's why we've moved to GiST and feel fine :-) That query we used in
our old project, now swithing to GiST.


> 			regards, tom lane
>

	Regards,
		Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83


In response to

pgsql-hackers by date

Next:From: Jan WieckDate: 2001-06-05 15:37:23
Subject: Re: Multiprocessor performance
Previous:From: Tom LaneDate: 2001-06-05 14:42:34
Subject: Re: Strange query plan

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