All Forums Database
stami27-2406 22 posts Joined 02/06
06 Jun 2006
Collecting Statistics on multiple Columns

Hi all,Is the orde of columns in the collect statistics statemen important or no?e.g. COLLECT STATISTICS ON table_1 COLUMN (column_2, column_1); orCOLLECT STATISTICS ON table_1 COLUMN (column_1, column_2); Thanks in advance

Phani 15 posts Joined 07/04
16 Jun 2006

I do not think it makes any difference. When different column combinations are analyzed, the combined stats are analyzed. Based on this analysis, optimizer estimates the combined cost.

stami27-2406 22 posts Joined 02/06
17 Jun 2006

Hi PhanyThanks for the reply.Does exist a place in the teradata documentation, where it is mentioned?greetings stami

BBR2 96 posts Joined 12/04
19 Jun 2006

It may be important for covered indexes.For normal columns, i am not that sure.Vinay

dnoeth 4628 posts Joined 11/04
19 Jun 2006

Hi stami27,there's no difference, if you collect stats on (col1, col2) or (col2, col1), because both stats are calculated exactly the same. Simple try it and then use a help stats:The order is defined by the column position within the create table, this behaviour is similar to a "create index(col1, col2)" or "create index(col2, col1)", both are the same in Teradata (unless you use a order by).Dieter


tdstar.rams 11 posts Joined 05/11
29 Dec 2011


    Can anybody explain, when the collect stats on multi-columns is use??


You must sign in to leave a comment.