Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 03 Jul 2003 @ 10:53:46 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Question about insert
 
From:   Claybourne Barrineau

Anomy,

Try this:

-- If pmart.fact_sales is a set table (default)
Create Table pmart.fact_sales_temp as pmart.fact_sales with no data;

-- Else, if pmart.fact_sales is a multiset table
Create Multiset Table pmart.fact_sales_temp as pmart.fact_sales with no data;

Insert into pmart.fact_sales_temp Select * From pmart.fact_sales
;Insert into pmart.fact_sales_temp Select * From pdata.shopping_trans;

-- This insert step needs to run in bteq, it will not work as intended in queryman. By placing the ";" in front of the second insert statement, the optimizer will treat these two insert statements as a "Multi-Statement" insert. By doing so, the RDBMS will not log the transactions in case of roll-back (which is the issue causing your insert to take so long...assuming the slow insert isn't a function of the tables skewed distribution)

Drop Table pmart.fact_sales;

Rename Table pmart.fact_sales_temp as pmart.fact_sales;


Hope this helps,

Clay



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023