Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Deadly sins againts database performance/scalability
Ryan Gaffuri wrote:
> "Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk> wrote in message news:<bq9n88$cdr$1$8300dec7_at_news.demon.co.uk>... >
> > > I also disgree that you should never create intermediate tables and > drop them. I think this is taken to an extreme. Now in a high > transaction system you should not because it causes latch contention > and affects throughput. > > However, in a DSS system or for nightly batch processes, Ive found > VERY large improvements in performance by doing create table as > nologging in paralel. Its much faster than inserting into a global > temp table. you dont have to worry about throughput if your looking at > 5-10 users on the system max. Now you need to document it well(which > most people dont do), so people know what to alter if you need to > scale to more users. If I only have a certain window of time to get a > series of batch processes done, Ill use temp tables like this. I find > they are very useful when working with remote databases. You do a > quick create table as to get just the data you need, then do your > joins to the local table, so your not pushing data across a DB link > for 10 different queries. > > However, this will not scale to alot of users. So it needs to be well > documented.
If you ever want to have some fun do the following:
CREATE TABLE test (testcol VARCHAR2(20)) NOLOGGING;
ALTER SESSION SET EVENTS '10046 trace name context forever, level 12';
INSERT INTO test VALUES ('ABC');
DROP TABLE test;
ALTER SESSION SET sql_trace = FALSE;
Then ...
CREATE GLOBAL TEMPORARY TABLE test (testcol VARCHAR2(20))
ON COMMIT DELETE ROWS;
ALTER SESSION SET EVENTS '10046 trace name context forever, level 12';
INSERT INTO test VALUES ('ABC');
COMMIT;
ALTER SESSION SET sql_trace = FALSE;
Run the trace files through TKPROF.
Take a good look at what Oracle does to drop that table. It is not exactly a thing of beauty. Necessary ... veryt expensive.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Mon Dec 01 2003 - 19:26:03 CST
![]() |
![]() |