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: INSERT into HUGE table

Re: INSERT into HUGE table

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: 2000/08/11
Message-ID: <965991891.26662.3.nnrp-14.9e984b29@news.demon.co.uk>#1/1

It depends to a degree on your requirements for control methods, the percentage of rows that will introduce duplicates and how you are sourcing the data.

One option for a largely SQL solution is:

    load staging table
    delete from staging where exists duplicate in main table     insert into main table select from staging table

--

Jonathan Lewis
Yet another Oracle-related web site:  http://www.jlcomp.demon.co.uk

Roger Palmen wrote in message <39927C92.9F93ADE1_at_alewijnse.nl>...

>Hi all,
>
>I'm trying to find the most efficient way to insert large amounts of
>records (lets say 100K a day) into a single huge table (100M records).
>However, the problem is that the set of records to insert contains
>records already in the target table. These duplicate records can either
>be overwritten or neglected.
>
>A simple but effective INSERT statement fails if only one record doesn't
>pass the PK-constraint. What is the most efficient way to do this?
>
>- Export / SQL-loader?
>- Delete rows from source?
>- Use PL/SQL and cursor to insert one record at a time?
>- Outer join with target?
>- etc?
>
>Using Oracle 8.1.6 on NT.
>
>Thanks for advice.
>Please reply to newsgroup, or pe1pvy_at_amsat.org NOT the sender.
>
>
Received on Fri Aug 11 2000 - 00:00:00 CDT

Original text of this message

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