|
|
Archives of the TeradataForum
Message Posted: Tue, 20 Nov 2012 @ 13:25:03 GMT
Subj: | | Re: How to generate Surrogate Key using CSUM? |
|
From: | | Lenka, Dipti Prakash |
Thanks Dieter.
If I go by the below given query, suppose we have million records in source table. In every each of records insert the subquery is getting
MAX(subline_id) value from target table and having addition with ROW_NUMBER() value. And I guess it will happen million times. Is not a
performance issue ?
SELECT ROW_NUMBER ()
OVER (ORDER BY subline_id)
+ ( SELECT COALESCE(MAX(subline_id), 0)
FROM ttmp.test_dipti_csum
)
FROM ttmp.test_dipti_csum AS STAGE;
Thanks,
Dipti Prakash
| |