Re: Strange query plan - Mailing list pgsql-hackers

From Oleg Bartunov
Subject Re: Strange query plan
Date
Msg-id Pine.GSO.4.33.0106051724350.26250-100000@ra.sai.msu.su
Whole thread Raw
In response to Re: Strange query plan  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, 5 Jun 2001, Tom Lane wrote:

> Oleg Bartunov <oleg@sai.msu.su> writes:
> > The best plan I've got eliminating  IN predicate:
> > 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 and idx.lid=59587 )
>
> Surely that returns zero rows?
>

Oops, sorry :-)
should be
select msg_prt.tid as mid from msg_prtwhere exists (select idx.tid from idx where msg_prt.tid=idx.tid              and
idx.did=1and ( idx.lid = 1207 or idx.lid=59587 ));
 

but this is not a big win.

Anyway, what's about original query ?



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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Strange query plan
Next
From: Oleg Bartunov
Date:
Subject: Re: Strange query plan