Collecting Statistics on multiple Columns
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Collecting Statistics on multiple Columns Expand / Collapse
Author
Message
Posted 6/6/2006 9:40:40 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/1/2006 12:37:00 PM
Posts: 22, Visits: 1
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);
or
COLLECT STATISTICS ON table_1 COLUMN (column_1, column_2);

Thanks in advance
Post #4315
Posted 6/16/2006 3:30:10 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 5/2/2008 2:28:55 AM
Posts: 15, Visits: 2
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.
Post #4387
Posted 6/17/2006 1:39:26 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/1/2006 12:37:00 PM
Posts: 22, Visits: 1
Hi Phany
Thanks for the reply.
Does exist a place in the teradata documentation, where it is mentioned?

greetings stami
Post #4388
Posted 6/19/2006 12:46:58 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 7/5/2009 2:58:22 PM
Posts: 134, Visits: 13
It may be important for covered indexes.
For normal columns, i am not that sure.



Vinay
Post #4389
Posted 6/19/2006 4:52:39 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 11/5/2009 4:40:02 PM
Posts: 717, Visits: 466
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
Post #4391
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 2:40pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.094. 9 queries. Compression Disabled.