Will the STATS be useful on below kind of data?

Database
Enthusiast

Will the STATS be useful on below kind of data?

I am new to teradata.

Will the STATS be useful on below kind of data?

                00000000001234561

                00000000001234562

                00000000001234563

                00000000001234564

                00000000001234565

                00000000001234566

                00000000001234567

                00000000001234568

                00000000001234569

                00000000001234560

                000000000012345610

                000000000012345611

                000000000012345612

                000000000012345613

                000000000012345614

                000000000012345615

                000000000012345616

                000000000012345618

                000000000012345619

I think we can do sample statistics. Since sample statistics is better than default Random AMP statistics, which the optimizer will do if statistics is not available. Please correct me if I am wrong.

3 REPLIES
Enthusiast

Re: Will the STATS be useful on below kind of data?

Hi ,

Stats would always be helpful to Optimizer as it gives the data Demographics i.e Unique values,nullabity,non nullabity in order to create the best plae time .

Sampled stats are recommended when the volume is too huge like 1 million, 2 million as full collect stats will be time consuming .

If no stats are collected then Optimzer will do a random amp sampling on the table in order to generate the plan for the query in which table is getting refered.

for more info. refer the below excellent link of carrie-

http://developer.teradata.com/blog/carrie/2010/04/tips-on-using-sampled-stats

cheers!

Nishant

Enthusiast

Re: Will the STATS be useful on below kind of data?

Depending on the release you are on and the data type of the column , sample stats may not be very useful.

If the column shown above is defined as character , it is larger than the 16 byte size that stats collection is most effective at.

Also if your table size is small , the sample is also not going to be the most effective.

I typicaly only used sample stats on USI's and UPI's (or anything fairly unique and not skewed) on very large tables (over several million rows) .

Enthusiast

Re: Will the STATS be useful on below kind of data?

Thanks a lot, Nishant and Shelley.