RE: [HACKERS] Idea for speeding up uncorrelated subqueries

From: "Ansley, Michael" <Michael(dot)Ansley(at)intec(dot)co(dot)za>
To: "'Bruce Momjian'" <maillist(at)candle(dot)pha(dot)pa(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Vadim Mikheev <vadim(at)krs(dot)ru>, pgsql-hackers(at)postgreSQL(dot)org
Subject: RE: [HACKERS] Idea for speeding up uncorrelated subqueries
Date: 1999-08-06 07:58:00
Message-ID: 1BF7C7482189D211B03F00805F8527F70ED0C3@S-NATH-EXCH2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I thought that all correlated and uncorrelated sub-queries could be
rewritten as a join, simplifying the query tree. It should be a mechanical
process which can probably be performed in the rewriter.

Somebody put me right.

MikeA

>> -----Original Message-----
>> From: Bruce Momjian [mailto:maillist(at)candle(dot)pha(dot)pa(dot)us]
>> Sent: Friday, August 06, 1999 7:11 AM
>> To: Tom Lane
>> Cc: Vadim Mikheev; pgsql-hackers(at)postgreSQL(dot)org
>> Subject: Re: [HACKERS] Idea for speeding up uncorrelated subqueries
>>
>>
>> > Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> writes:
>> > > Isn't it something that takes only a few hours to
>> implement. We can't
>> > > keep telling people to us EXISTS, especially because
>> most SQL people
>> > > think correlated queries are slower that non-correlated
>> ones. Can we
>> > > just on-the-fly rewrite the query to use exists?
>> >
>> > I was just about to suggest exactly that. The "IN (subselect)"
>> > notation seems to be a lot more intuitive --- at least, people
>> > keep coming up with it --- so why not rewrite it to the EXISTS
>> > form, if we can handle that more efficiently?
>>
>> Yes, we have the nice subselect feature. I just hate to see it not
>> completely finished, performance-wise.
>>
>> --
>> Bruce Momjian | http://www.op.net/~candle
>> maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
>> + If your life is a hard drive, | 830 Blythe Avenue
>> + Christ can be your backup. | Drexel Hill,
>> Pennsylvania 19026
>>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vadim Mikheev 1999-08-06 08:12:59 Re: [HACKERS] Idea for speeding up uncorrelated subqueries
Previous Message Bruce Momjian 1999-08-06 05:11:23 Re: [HACKERS] Idea for speeding up uncorrelated subqueries