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

Home -> Community -> Usenet -> c.d.o.server -> Re: Global temporary tables v pl/sql tables

Re: Global temporary tables v pl/sql tables

From: Nuno Souto <nsouto_at_optushome.com.au.nospam>
Date: Tue, 9 Jul 2002 18:26:06 +1000
Message-ID: <3d2a9faf$0$11268$afc38c87@news.optusnet.com.au>


In article <zMtW8.31045$Hj3.94011_at_newsfeeds.bigpond.com>, you said (and I quote):
>
> "Ryan" <rgaffuri_at_cox.net> wrote in message
> news:cpoW8.68471$DB.1742984_at_news1.east.cox.net...
> > What about performance comparisons? I know that in some cases pl/sql
> tables
> > are useful if you need to do a series of joins and /or sorts you can load
> > one table into memory by putting it in a pl/sql table.
>
> Exactly. The data is all stored in memory and hence can be reaccessed very
> effeciently. The issue of course is do you have sufficient memory available.
> Or would it be useful to access this data multiple times from multiple
> pieces or executions of code, etc. Then a GTT could be useful.
>

A minor word of caution here (this is a V7 and V8.0 observation, might be different with 8i or 9i compiled PL/SQL).

Assuming you have a normal block of code where a main cursor executes a basic SELECT that is going to provide rows processed in a tight loop:

-Always use a PLS_INTEGER typed variable to index and point to the inmemory  table: they are so much faster than NUMBER for integer operations it's not even funny...

Of course: try this with your own settings and version: it'd be highly dependent on Oracle version, I'd say.

-- 
Cheers
Nuno Souto
nsouto_at_optushome.com.au.nospam
Received on Tue Jul 09 2002 - 03:26:06 CDT

Original text of this message

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