Re: oracle query

From: Aloha Kakuikanu <alohakaku_at_yahoo.com>
Date: Tue, 06 Feb 2001 17:35:34 GMT
Message-ID: <95pcl6$egp$1_at_nnrp1.deja.com>


In article <95movl$5hq$1_at_nnrp1.deja.com>,   Vadim Tropashko <vadimtro_at_yahoo.com> wrote:
> In article <95fl8f$21c$1_at_nnrp1.deja.com>,
> Aloha Kakuikanu <alohakaku_at_yahoo.com> wrote:
> > In article <95fcin$qgb$1_at_nnrp1.deja.com>,
 

> > BTW, try to query Greatest Common Divisor -- I've read that
> > SQL is incomplete, so you cannot calculate anything your way.
>
> select max(c.gcd) from
> (select rownum as x from PHONES where rownum < 15) a,
> (select rownum as y from PHONES where rownum < 15) b,
> (select rownum as gcd from PHONES where rownum < 15) c
> where gcd*x=6
> and gcd*y=9
>
> (Those limitations are because the RDBMS I use comes with very
> inefficient plan)

I ran your query just for fun. Optimizer plan for your masterpiece scans all your tables in memory and then performes lots of nested loops. The cost is almost a billion, literally. By any chance, do you know Euclid algorithm?

Sent via Deja.com
http://www.deja.com/ Received on Tue Feb 06 2001 - 18:35:34 CET

Original text of this message