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

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

RE: Which is faster?

From: Johan Locke_at_i-Commerce Services <Locke_at_i-Commerce>
Date: Tue, 20 Feb 2001 04:18:20 -0800
Message-ID: <F001.002B8856.20010220035026@fatcity.com>

I don't think there is any question.

A smart select statement always tends to be a better solution.

The one instance where I'd definitly prefer a procedure over a select is when the select contains Oracle's tree-walk method (i.e. connect by prior... start with)

Regards
JL

-----Original Message-----
Sent: Tuesday, February 20, 2001 12:31 PM To: Multiple recipients of list ORACLE-L

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).
--

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

Author: Johan Locke_at_i-Commerce Services
  INET: Johan.Locke_at_za.didata.com
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 - 06:18:20 CST

Original text of this message

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