All Forums Database
drmkd17 54 posts Joined 10/12
24 Jun 2016
High Skewfactor inspite of even distribution

Hi All,
 
Today i came across a weird scenario in Teradata. 
One of my tables dbc.table_a  was highly skewed with a skewfactor of 95.77 . I used the below query to check the skewfactor.
SELECT
TABLENAME,
SUM(CURRENTPERM) /(1024*1024) AS CURRENTPERM,
(100 - (AVG(CURRENTPERM)/MAX(CURRENTPERM)*100)) AS SKEWFACTOR
FROM
DBC.TABLESIZE
WHERE DATABASENAME= <DATABASENAME>
AND
TABLENAME =<TABLENAME>
GROUP BY 1;
I changed the primary index of the table and the distribution was quite even 23 amps.. 69367 rows. least count on amp was 2894 and highest count of rows on amp was 3170
When I ran the same query again to check the skew factor it was still 95.77. 
But when I changed the tablename to DBC.xys the skewfactor reduced to 5.66.
This happend because even when I dropped table dbc.table_A there were rows in my dbc.tablesize for that table and hence the wrong skewfactor. Any changes that I need to make to the skewfactor query. 
any suggestions??

dejo316 5 posts Joined 03/16
24 Jun 2016

So after you changed the PI and re-loaded the table, are you sure that you checked the skew on the new table (the one with the fixed PI)? 

dnoeth 4628 posts Joined 11/04
26 Jun 2016

Is the tablename longer than 30 characters?
You're using dbc.TableSize instead of dbc.TableSizeV.

Dieter

drmkd17 54 posts Joined 10/12
26 Jun 2016

Yes Dieter.
That solved my problem. How are dbc.tablesize and dbc.tablesizev different?? Will have to find this out.
Thanks a lot!

dnoeth 4628 posts Joined 11/04
26 Jun 2016

Since TD12 all dbc-views without V/VX were legacy because they return CHAR(30) LATIN instead of the new VARCHAR(128) UNICODE, i.e. compatibilty views.
TD14.10 finally enabled long object names, so the old ones were deprecated.
There was enough time to get used to :)

Dieter

drmkd17 54 posts Joined 10/12
26 Jun 2016

Thanks for that piece of information. 
Thanks Dieter!

Hustler 9 posts Joined 12/15
12 Jul 2016

Hi all,
 
Does Skew factor affect the backup time?

Thanks,
Komal

You must sign in to leave a comment.