|
Archives of the TeradataForumMessage Posted: Mon, 22 Oct 2007 @ 14:02:39 GMT
David Clough wrote:
You probably already do it, but don't forget to add CASESPECIFIC to any [Var]Char during calculation.
I'd do all the calculations for all columns based on bits and finally multiply with row count.
I wrote the basic part some years ago (extracting the 255 most common values + NULL), but stopped after some easy calculations (how many bytes saved by x compressed values compared to uncompressed/varchar). As this was just a kind of exercise using all those nice SP features, i stopped when it was about exact calculation :-) - Table header size will increase at least by (number of compressed values * number of AMPs). But if the table is large this might be negligible. - The number of additional Presence Bytes per row should be: (NULLable columns + Compress Bits) / 8. - In worst case adding a single presence *bit* might cause an added presence *byte*. But rows are word-aligned, so maybe this doesn't matter. - If it's a Varchar to be compressed then substract 2 bytes oberhead, but if it's the last remaining Varchar then 4 bytes. And there are probably other considerations, this i why i never did that exact calculation... Btw, now there are 64-bit systems, so this is even worse, due to pad byte fields and alignment issues :-( Dieter
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||