Kevin wrote:
>
> While I'm sure it's just because of the simplicity of this example, it
> seems that the query could be reorganized to avoid this double query:
>
> select * from foo F, bar B where B.name = 'bla' and (B.name = F.name or
> B.type = F.type);
That was the original format of the que
Andrew McMillan wrote:
>
> mlw wrote:
> >
> > Take these queries:
> >
> > select * from foo as F, (select * from bar where name = 'bla') as B where
> > F.name = B.name
> > union all
> > select * from foo as F, (select * from bar where name = 'bla') as B where
> > F.type = B.type
> >
> > OR
> >
>
Take these queries:
select * from foo as F, (select * from bar where name = 'bla') as B where
F.name = B.name
union all
select * from foo as F, (select * from bar where name = 'bla') as B where
F.type = B.type
OR
create temp table B as select * from bar where name = 'bla';
select * from foo as