PL/SQL (MOSC)

MOSC Banner

Inserting 400 Million rows

edited Aug 6, 2010 5:35AM in PL/SQL (MOSC) 15 commentsAnswered
 Hi,

I have a table table 1 and have the need to run the following to create the contents of table 2.

insert into t2 select a.col1, a.col2, b.col1, b.col2 from t1 a, t1 b

Table 1      

col1   col2

a         1

b          2

c         3

would result in

table 2

col1  col2  col3  col4

a       1       a       1

a       1       b       2

a       1      c         3

b       2      a         1

b       2       b       2

b       2        c       3

....  etc

The problem is my table 1 has 20,000 rows in it and the resulting table has 20k x 20k rows ... and it takes FOREVER .. if it finishes. 

What would be the best way to tackle this for time efficiency ???

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center