SELECT puzzle
Date: Wed, 06 Apr 94 22:23:32 GMT
Message-ID: <765671012snx_at_kbigate.stgt.sub.org>
where a1 > 0 /* will use index */
declare cursor b1_cursor as
select b1, sum(b3), count(*) from b
where b1 > 0 and b2 > 0 /* will use index */ and (b1,b5) not in (select c1,c5 from c where c1 = b1 and c5 = b5)group by b1
order by b1
declare cursor c1_cursor as
select c1, sum(c3), count(*) from c
where c1 > 0 and c2 > 0 /* will use index */
group by c1
order by c1
This way, I think I can minimize the interaction between the RDBMS and the application.
Any ideas how to optimize this problem ? I tried using a view, and
using SELECT... UNION for B and C; but they both try to first resolve
the complete query and therefore need a huge temporary space ?
BTW, I am using Oracle V6 on a RS/6000.
Any comments are welcome.
Willy Klotz
Willys Mail FidoNet 2:2474/117 2:2474/118 Mail Only System
CIS: 100020,3517 USR Courier HST dual standard
willyk_at_kbigate.stgt.sub.org
-> No Request from 06.00 to 08.00 <-
======================================================================
Received on Thu Apr 07 1994 - 00:23:32 CEST