Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Which is faster?

Which is faster?

From: Andor Gyula <gy.andor_at_euromacc.hu>
Date: Tue, 20 Feb 2001 02:33:15 -0800
Message-ID: <F001.002B87D0.20010220023034@fatcity.com>

Hi Gurus !

I'm going to some tables with huge amount of records. There are references between these tables. The
question is:
Does it worth creating a procedure with several small selects or is it faster to use one select with
joins?

For example:
CUSTOMER(CUST_ID);
CONTRACT(CONTR_ID,CUST_ID);
CONTRACT_ITEM(CONTR_I_ID,CONTR_ID,PHONE_NUM_ID); PHONE_NUMBER(PHONE_NUM_ID,PHONE_NUM); I have the PHONE_NUM and I need the CUST_ID.

Which Faster?
SELECT CUST_ID from PHONE_NUM,CONTRACT_ITEM,CONTRACT,CUSTOMER where .... [JOINS] and PHONE_NUM=searchedone

or In procedure or function

select phone_num_id into Variable from phone where phone_num=searchedone; select contract_id into Variable2 from contract_item where phone_num_id=Variable; select cust_id into Variable from contract where contr_id=Variable2;

Thanks in advance.
Gyula

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Andor Gyula
  INET: gy.andor_at_euromacc.hu

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (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). Received on Tue Feb 20 2001 - 04:33:15 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US