RE: select count(case ...) slow in PL/SQL, any better way?

2003-02-25 Thread Connor McDonald
Seems to be different queries to me: select count(case ... ) into count1, count(case ... ) into count2 from isi.nametag suggests a full scan on isi.nametag whereas the two separate queries: select count(*) from isi.nametag where geneid=geneid1 select count(*) from isi.nametag where

RE: select count(case ...) slow in PL/SQL, any better way?

2003-02-24 Thread gmei
Hi: Just after I sent my original message, it occured to me that I could use this to optimize the sql (gneid is the PK column of the table): select count(A.geneid), count(B.geneid) into count1, count2 from isi.nametag A , isi.nametag B where A.geneid=geneid1 and B.geneid=geneid2; Guang

Re: select count(case ...) slow in PL/SQL, any better way?

2003-02-24 Thread Stephane Faroult
gmei wrote: Hi: Just after I sent my original message, it occured to me that I could use this to optimize the sql (gneid is the PK column of the table): select count(A.geneid), count(B.geneid) into count1, count2 from isi.nametag A , isi.nametag B where A.geneid=geneid1 and

Re: select count(case ...) slow in PL/SQL, any better way?

2003-02-24 Thread Mark Richard
Hi, How about a statement like select count(decode(geneid, geneid1, 1, 0)), count(decode(geneid, geneid2, 1, 0)) into count1, count2 from isi.nametag This should produce the same result I believe, and is one single simple SQL statement so PL/SQL should eat it up just fine.

RE: select count(case ...) slow in PL/SQL, any better way?

2003-02-24 Thread netmadcap
I too faced the problem of case not working in pl/sql procedures. So I created a view. Would creating a view work for you ? -Original Message- Sent: Monday, February 24, 2003 3:07 PM To: Multiple recipients of list ORACLE-L Hi: Oracle 8173 on Sun Solaris 2.8. I am trying to optimize

RE: select count(case ...) slow in PL/SQL, any better way?

2003-02-24 Thread Sarnowski, Chris
responses to 2 posts: comments below each post. -Original Message- From: gmei [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 4:53 PM To: Multiple recipients of list ORACLE-L Subject: RE: select count(case ...) slow in PL/SQL, any better way? Hi: Just after I sent

RE: select count(case ...) slow in PL/SQL, any better way?

2003-02-24 Thread Sarnowski, Chris
Upon further thought, what are you trying to gain by this optimization? If these are primary key values, you will do a unique index lookup and they should both be very fast. If you are doing millions of these, you may want to rethink the whole algorithm (this said without knowing how you are

RE: select count(case ...) slow in PL/SQL, any better way?

2003-02-24 Thread Darrell Landrum
I thought case in PL/SQL was not available until 9i. I'll have to look that up. [EMAIL PROTECTED] 02/24/03 04:38PM I too faced the problem of case not working in pl/sql procedures. So I created a view. Would creating a view work for you ? -Original Message- Sent: Monday, February

Re: select count(case ...) slow in PL/SQL, any better way?

2003-02-24 Thread Daniel W. Fink
CASE appeared (with little fanfare) in 8.1.6. However, until Oracle9, it was not available in PL/SQL, when they integrated the PL/SQL engine into the kernel. Darrell Landrum wrote: I thought case in PL/SQL was not available until 9i. I'll have to look that up.

Re: select count(case ...) slow in PL/SQL, any better way?

2003-02-24 Thread Darrell Landrum
Thanks! [EMAIL PROTECTED] 02/24/03 06:28PM CASE appeared (with little fanfare) in 8.1.6. However, until Oracle9, it was not available in PL/SQL, when they integrated the PL/SQL engine into the kernel. Darrell Landrum wrote: I thought case in PL/SQL was not available until 9i. I'll have to