Effect of reversing the order of columns in mutli-column stats

Data Modeling
Enthusiast

Effect of reversing the order of columns in mutli-column stats

Does it make a difference if we reverse the order of the columns mentioned in multi-column stats.

Eg:- collect stats on emp column (a,b)  Vs  collect stats on emp column (b,a)

Cheers :-)

SK

4 REPLIES
Supporter

Re: Effect of reversing the order of columns in mutli-column stats

at least up to 13.10 - I am not 100% sure about 14.0.

see http://developer.teradata.com/blog/carrie/2012/04/teradata-13-10-statistics-collection-recommendatio...

Only the 16 bytes of the concatenated columns are use. So order can change the results if the concatenated column length > 16 bytes.

Teradata Employee

Re: Effect of reversing the order of columns in mutli-column stats

You might get more responses in a forum on performance.  This forum is on data modeling.

Enthusiast

Re: Effect of reversing the order of columns in mutli-column stats

I believe the order is determined by the order in which the columns are defined in the table definition (up to 13.10).  It is a good practive to define smaller sized columns first just in case they are involved in a multi-column stats statement.

Enthusiast

Re: Effect of reversing the order of columns in mutli-column stats

I am new to this forum, so misplaced the posting.

Thanks ulrich for the link provided.Till 13.10 the order does not matter as it is determined from table definition as goldminer mentioned, Thanks goldminer for that. But from 14, the order mentioned in collect stats statement takes precedence over table definition.