All Forums Data Modeling
terasum 13 posts Joined 10/12
12 Jun 2013
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 :-)

ulrich 816 posts Joined 09/09
12 Jun 2013

at least up to 13.10 - I am not 100% sure about 14.0.
Only the 16 bytes of the concatenated columns are use. So order can change the results if the concatenated column length > 16 bytes.

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

HCDM 21 posts Joined 05/10
12 Jun 2013

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

Lee Arnett
Product Manager
Teradata Healthcare Logical Data Model (HC-LDM)

goldminer 118 posts Joined 05/09
12 Jun 2013

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.

terasum 13 posts Joined 10/12
13 Jun 2013

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.

You must sign in to leave a comment.