Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sat, 19 Sep 2009 @ 09:22:36 GMT


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


Subj:   Re: Update of millions of records
 
From:   Victor Sokovin

  If the fields being updated don't have stats, the comparison would be "update in place" versus "insert to empty table + collect stats + make grants ," not just "update in place" versus "insert to empty table + make grants." (Leaving aside other issues like availability during the update, space limits, etc.)  


The original posting did not contain much context for the question so it leaves us the freedom of adding any context or specific cases we would like to discuss. We often had threads like this on the Forum and I never failed to learn something new when participants were looking from different angles at what I thought I already knew all about.

When I was reading the question for the first time I thought it would refer to the situation when the table has to stay ONLINE during the UPDATE. The OP had the choice between the direct SQL and utility UPDATE.

ONLINE / OFFLINE are two separate modes of operation in Teradata. Both in use and are interesting in their own right.

Scenarios with RENAME fit in the OFFLINE mode. They involve rebuilding of data, secondary structures such as indexes, triggers, grants and stats.

Jonathan mentioned this method would save us CPU. I would not agree with this in general. The method takes away the pressure from the original table but the CPU is still used a lot around the activities on the temp table in addition to using extra space and having to spend time on writing scripts etc.

Speaking of rebuilding the stats, one might consider using TSET to save away the original stats and then attaching them to the temp table before the RENAME.

It would be interesting to hear from people who actually do this in production and whether they have encountered any practical issues with this approach. I have not seen it myself on Teradata or Oracle environments I've been working on. There seems to be some mistrust among the DBAs.


Victor



     
  <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