Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 12 Dec 2002 @ 17:07:31 GMT


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


Subj:   Re: Estimating row count
 
From:   Anomy Anom

<-- Anonymously Posted: Wednesday, December 11, 2002 04:45 -->

Hi

The ARCHIVE output, the HELP index and the HELP STATISTICS commands are useful for estimating row counts. As far as I am aware, it is not easy to use the output from these commands to be used in further processing.

If you require the precise number of rows, I suggest the following.

1. I assume there is a date field in this large table representing an event date, eg business date, transaction date etc.

2. Create a log table with a minimum of 2 columns, business_date and number_of_rows. Take a once off hit to initially populate this table with something like

insert into log_table
SELECT MAX(business_date), count(*)
from big_table;

3. If you use multiload to load your table daily, weekly etc, use the &SYSINSCNT to write to the log. However, you will need to accept in the business_date from a file.

4. If you use a staging table (eg a fastloaded table for further processing), you can use the insert/select business_dte, count(*) from staging table.

This has the advantage in that the log table can be used rather than the large table to tell you if the data for a given date has been loaded and also how many rows were loaded for that date.

Finally, a simple sum of the number_of_rows column will answer your immediate question

Hope this helps



     
  <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