I'm not sure if this applies to 14, but prior versions are a bit tricky when collecting multicolumn stats. The optimizer only looks at the first 16 bytes of data. For example, if I am collecting on (desc,code) and description is over 16 bytes, and the majority of the demographics are duplicates on the first 16 bytes, this will not be helpful. The order in which the optimizer looks at the demographics in multicolumn stats is NOT the order in which the collect statement is executed (i.e. collect stats on tablename column(code,desc)), but rather the order in which the columns are defined in the table. If the order in the table is code then desc, then you will be ok no matter what order they are defined in the collect stats statement. It is a good practice to define shorter length columns before the longer length columns, especially if you suspect the groupings could be used in multi columns statistics collection. I don't think this applies in 14.0, but I could be wrong.
I'm not sure if this applies to 14, but prior versions are a bit tricky when collecting multicolumn stats. The optimizer only looks at the first 16 bytes of data. For example, if I am collecting on (desc,code) and description is over 16 bytes, and the majority of the demographics are duplicates on the first 16 bytes, this will not be helpful. The order in which the optimizer looks at the demographics in multicolumn stats is NOT the order in which the collect statement is executed (i.e. collect stats on tablename column(code,desc)), but rather the order in which the columns are defined in the table. If the order in the table is code then desc, then you will be ok no matter what order they are defined in the collect stats statement. It is a good practice to define shorter length columns before the longer length columns, especially if you suspect the groupings could be used in multi columns statistics collection. I don't think this applies in 14.0, but I could be wrong.