Bruce Momjian wrote:
>
> > >
> > > Seems the optimizer could either hash the subquery, or us an index.
> > > Certainly would be faster than a sequental scan, no?
> >
> > Optimizer should hash the subquery, but I didn't implement this -:(
> > Try to rewrite query using NOT EXISTS and index will be used.
>
> How hard would it be to implement it? I know you are deep into MVCC,
> but doing a nested loop to join a subquery is really bad.
Not very hard, for un-correlated subqueries at least.
I have no time to do this for 6.5...
>
...
>
> All queries can't be rewritten as EXISTS.
All except of subqueries with aggregates in target list.
Vadim