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 using the counts - and don't tell me because we are competitors).

-Chris

> -----Original Message-----
> From: gmei [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 24, 2003 4:07 PM
> To: Multiple recipients of list ORACLE-L
> Subject: select count(case ...) slow in PL/SQL, any better way? 
> 
> 
> Hi:
> 
> Oracle 8173 on Sun Solaris 2.8. I am trying to "optimize" the 
> follwoing code
> (in an PL/SQL package) into one table call (instead of two)
> 
>   select count(1) into count1 from isi.nametag where geneid=geneid1;
>   select count(1) into count2 from isi.nametag where geneid=geneid2;
> 


LEGAL NOTICE:
Unless expressly stated otherwise, this message is confidential and may be privileged. 
It is intended for the addressee(s) only. Access to this e-mail by anyone else is 
unauthorized. If you are not an addressee, any disclosure or copying of the contents 
or any action taken (or not taken) in reliance on it is unauthorized and may be 
unlawful. If you are not an addressee, please inform the sender immediately.
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Sarnowski, Chris
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to