Re: [HACKERS] Subqueries and indexes

From: Vadim Mikheev <vadim(at)krs(dot)ru>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Subqueries and indexes
Date: 1999-03-17 07:07:36
Message-ID: 36EF54B8.D1B6F7C5@krs.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas IZ5 1999-03-17 08:29:00 Re: [HACKERS] Associative Operators? (Was: Re: [NOVICE] Out of f rying pan, into fire)
Previous Message Vadim Mikheev 1999-03-17 06:57:48 Re: [HACKERS] Sequences....