> how does this differ from:
>
> select *
> from dbmedia
> where dbmedia.id=wdmedia.id
> and wdmedia.word='whatever'
> limit 200;
hey...
thanks for that..
that was surely better...
but now returning to the main point...
how can i execute the following query in the form above?
select * from dbmedia where id IN ((select ID from wdmedia where word='word1')
INTERSECT (select ID from wdmedia where word='word2') ...so on)
thanks again
> I think it's called "pilot error". Your query asked to run the subquery for
> each row in the outer query, so ofcourse you get a sequential scan. If what
> you wanted was an index scan then you should rewrite it as a join (as above)
> and use that.
>
> If you can prove that your EXISTS statement is equivalent to the JOIN for
> all different types of subqueries, perhaps it can be made automatic.
> --
> Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> > There are 10 kinds of people in the world, those that can do binary
> > arithmetic and those that can't.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
--
------
Varun
Best file compression around: "DEL *.*" = 100% compression