Re: Highly obscure and erratic - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Highly obscure and erratic
Date
Msg-id 20020618161330.D66586-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: Highly obscure and erratic  (Varun Kacholia <varunk@cse.iitb.ac.in>)
Responses Re: Highly obscure and erratic  (Shaun Thomas <sthomas@townnews.com>)
List pgsql-general
On Wed, 19 Jun 2002, Varun Kacholia wrote:

>
> > What does explain show for the exists version?
>
> suryadb=# explain select * from dbmedia where EXISTS (select ID from
> wdmedia where word='whatever' AND dbmedia.id=id )  LIMIT 200;
> NOTICE:  QUERY PLAN:
>
> Limit  (cost=0.00..1006732.42 rows=200 width=76)
>   ->  Seq Scan on dbmedia  (cost=0.00..507810931.25 rows=100883 width=76)
>           SubPlan
>                     -> Index Scan using wdkmedia on wdmedia
> (cost=0.00..5033.63 rows=1 width=4)
>
>                     EXPLAIN
>
> still seq scan :((

Yeah...

Do either of these run better?

select dbmedia.* from dbmedia, wdmedia where wdmedia.word='whatever' and
  dbmedia.id=wdmedia.id;

select * from dbmedia, (select ID from wdmedia where word='whatever') AS w
 where w.id=dbmedia.id;


> someone please fix this bug :(
I'd guess it's not that simple.


pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: CAST(null as date)...
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Very Very Wierd