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: A quick pl/sql datatypes question

Re: A quick pl/sql datatypes question

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Mon, 27 Aug 2001 10:03:07 -0700
Message-ID: <F001.00378750.20010827102221@fatcity.com>

>From a pure performance direction,
pls_integer or binary_integer is probably the fastest.

If you declare a variable to be of

    table_name.column_name%type
there are implicit constraints on the
variable and any pl/sql assignments
(in particular arithmetic operations)
have to check that the result matches
those constraints. At one time I believe this meant using a temporary variable
to hold a result, then copying the result if the constraint was matched.

Having said that, you could try a few simple tests to find out that the differences (in new releases) are incredibly small.

Jonathan Lewis

Host to The Co-Operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Author of:
Practical Oracle 8i: Building Efficient Databases See http://www.jlcomp.demon.co.uk/book_rev.html

For latest news of public appearances
See http://www.jlcomp.demon.co.uk

Screen saver or Life saver: http://www.ud.com Use spare CPU to assist in cancer research.

-----Original Message-----
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> Date: 27 August 2001 17:13

|Dear gurus !
|What is better performance-wise - to declare a variable inside a
pl/sql
|block (or a trigger) as integer (number , Pls_integer etc..) or as
|mytable.mycolumn%TYPE .
|Again , i'm concerned ONLY about performance in this question.
|
|Thanks a lot.
|
|DBAndrey
|
|* 03-9254520
|* 053-464562
|* mailto:andreyb_at_elrontelesoft.com

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jonathan Lewis
  INET: jonathan_at_jlcomp.demon.co.uk

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 Mon Aug 27 2001 - 12:03:07 CDT

Original text of this message

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