Archives of the TeradataForum
Message Posted: Wed, 19 May 2004 @ 11:24:02 GMT
Geoffrey Rommel wrote:
Did you consider that the char(15) needs 15 bytes/row vs. 8 bytes for decimal(13)?
Elapsed time Total CPU Total I/O's decimal(13) 5:28 1,931.18 1,950,115 char(15) 5:21 4,043.43 8,818,803
Do you have any idea why the IOs are more than 4 times higher? Cache hits? I tried a similar approach and had the same IOs.
IMHO an [huge?/small?] part of the difference in CPU time is due to Rowhash duplicates. A merge join first compares RowHashes and if they're the same then compares the data.
I just did a count(distinct rowhash) on 3.000.000 distinct numbers:
3.000.000 decimal 788.749 trim(trailing from decimal)
So joining the table to itself would result in:
sel sum(cnt * cnt) from (sel hashrow(i) as h, count(*) as cnt from pitest1 group by 1 ) dt
18.050.002 RowHash/Data comparisons vs. 3.000.000
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|