Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Tue, 20 Nov 2012 @ 13:25:03 GMT

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

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 ?

        OVER (ORDER BY subline_id)
        + ( SELECT COALESCE(MAX(subline_id), 0)
            FROM ttmp.test_dipti_csum
     FROM ttmp.test_dipti_csum  AS STAGE;


Dipti Prakash

  <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