Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 16 Oct 2006 @ 18:17:18 GMT


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


Subj:   Re: Way to Copy Statistics.
 
From:   frank.c.martinez

I understood, just didn't want to stick my nose, since I didn't write the following, I just rewrote it for our our use at our site. Now, caveat, this is for a single table, not a whole set of tables, but I believe there's a way to do this in a batch type way, since I think TSET issues commands underneath the covers. So here goes (and this is a copy of our documentation, so I didn't edit it or nothing). Again, this was developed from what someone else on the forum gave me ("We see so far because we stand on the shoulders of giants." -- Issac Newton). Enjoy.

iv


-------------------------------
This procedure works when copying a table where the copy does not affect the existing statistics, for example, when changing the date in a column that doesn't have stats collected on it. It could also work for tables that are to be completely reloaded with the same number of records, with the same distribution on the columns. I would think it would also work to copy over most of the statistics and then collect stats only on the columns that change.

Create the copy of the table to be replaced and put data into it.

1) Start, the Teradata System Emulation Tool (TSet) and connect to the Teradata database.

2) Select >>Tools>>Export... and click the "Database" radio button in the "Export By" box. Change the file and folder name as you feel appropriate.

3) Click the "OK" button and navigate to target table in the "List of Objects:" window. You have to double click each database in the hierarchy in order to see lower level objects.

4) Highlight the target table and click the "Add" button. Check the "Statistics" select box in the "Export Options" box.

5) Click the "Export" button at the bottom of the modal dialog box.


Rename the copied table to the real name, and save off the original table for safety. Then the statistics can be imported for the new table now that it has the original name.

1) Make sure you're back in TSet.

2) Select >>Tools>>Import off of the main menu, and then select the TSET Control file (.mcf) from the file open dialog.

3) Navigate to the target table in the tree in left window of the screen.

4) Highlight the "Stats Tags" underneath it; this might be where it's possible to import stats for just one column at a time.

5) Select >>Tools>>Import again. If the option is not available, you can also use the Import button on the toolbar. You'll get a Warning message asking if you'd really like to do this. Click "Yes".


You should then compare the stats on the original and copied table to verify that you did what you thought you were doing. After a successful import, you can also delete the TSet Control file.


-------------------------------

iv



     
  <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