Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Tue, 04 Feb 2003 @ 16:43:03 GMT

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

Subj:   Re: CHAR vs VARCHAR
From:   Judge, James A

Two things to try for evaluation of column (this assumes you have the column in a table in Teradata.

Use the CHAR (charlength operator) to find avg length of varchar Select AVG (CHAR (varcharcolumn) from tablename. This will tell you if the 2 byte overhead is worth it based on the average length of column data.

Do a compress evaluation by Select columnname, COUNT(*) from tablename group by 1 order by 2 desc; . If there is a value that is in say 20% of the rows (actually you could code that calculation in the previous SQL using a derived table for COUNT(*) for all row count). And the amount of bytes saved would be less than the 1st query value (+2byte overhead X # of rows); you get the idea.

  <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: 28 Jun 2020