Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Mon, 17 Mar 2008 @ 23:48:45 GMT

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

Subj:   Re: Creating a table with a 0 skew factor
From:   Curley, David

You don't say how many rows you inserted, but if it's less than the number of AMPs, the table can't help but be skewed.

I've heard from a couple people that UPIs can't be skewed, but nobody's actually been able to explain why. On the other hand, it's trivial to create a highly skewed UPI table, so perhaps I just misheard them. Maybe they just meant it's unlikely.

I'm curious about why you're doing this in the first place, though. You paid how much for this disk space and you're going to lock it away? Maybe your local powers that be would also want stop users from submitting queries - that should keep a lot of CPU available, too ;) Why not just allocate space to a new database and leave it empty so it's available for spool, then reallocate it if you need it for data?

If you really wanted to make it non-skewed and you knew the total number of rows you wanted, base it off an existing big table. Say you wanted 100 rows on each AMP:

     insert into COD_1 (seq_no)
     select rn
     (select row_number() over (order by 1) rn
     from some_big_table) list_of_rn
     qualify row_number() over (partition by hashamp(hashbucket(hashrow(rn)))
     order by rn) < 101


  <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