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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Optimising PL/SQL Script. Takes 2 days to run.

Re: Optimising PL/SQL Script. Takes 2 days to run.

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Wed, 22 Jan 2003 13:32:49 -0000
Message-ID: <3e2e9d81$0$227$ed9e5944@reading.news.pipex.net>


"David FitzGerald" <david_at_fitzg.com> wrote in message news:7f966bc5.0301220521.104eb3e4_at_posting.google.com...
> Since I posted last, I did what you said and changed the date, removed
> the loop and used 7 inserts and I also disabled all constraints and
> indexes on the table. As a result, things seem to run about 40%
> faster. Wow! Hopefully since the data is being inserted in a good
> order the rebuilding of the index will be fast.

well fast may be a relative term!

> On a sidenote -- if it errors during the insert, is it possible to
> tell Oracle to re-run picking up where it left off?

Oracle will rollback your uncommitted changes, so

If you do no commits until the end then no changes will be made - but undo space required will be huge.
If you commit after each insert you only have to retry the failed inserts. If you commit within a loop then who can tell how far you've got - but it sounds like you aren't doing this.

You could also try doing direct path inserts

insert /*+ APPEND */ into FORECAST. This should bring you speed and resource saving benefits, though it may cost disk space since IIRC it creates new blocks above the HWM for the table.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer

******************************************
Received on Wed Jan 22 2003 - 07:32:49 CST

Original text of this message

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