Collecting stats on unused column

Database
Enthusiast

Collecting stats on unused column

Hi All,

    Does collecting stats on unused columns in anyway influence the execution plan.

Ex

sel t1.* from table1 t1 join table2 t2 on t1.col1 = t2.col1

lets say if i collect stats on col2, col3 and so on in both the tables.

Except for the unnecessary overhead for collecting the stats does it in anyways impact any other thing??  Because i keep getting advice from ma senior colleagues that it will have an impact on query execution plan.

If not now, was it the case in any previous versions?

3 REPLIES
Enthusiast

Re: Collecting stats on unused column

Could someone pls confirm/deny these? Thanks.

Teradata Employee

Re: Collecting stats on unused column

Hi,

there are great articles from Carrie on what statistics should be collected.  

http://developer.teradata.com/blog/carrie/2013/02/statistics-collection-recommendations-teradata-14-....

Does a statistic impact any other thing - just see EXPLAIN, before and after adding the new statistic.    Whether those two EXPLAINs are the same or not. ;)

Re: Collecting stats on unused column

Hi,

Collecting stats on unused columns is not advisable. In the above case, it will not impact the query performance. If you dont collect on the columns which are used in the query (usually in joins/where clause) then it will impact the performance

Collecting stats will use system resources and henceforth it is advised to collect stats on the columns which are frequently used in the query and which has high performance impact.

collecting stats on unused columns is like buying something and keeping it @home which is not used. Simply you are investing resources thats it

Hope this helps