COLLECT STATISTICS
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.


COLLECT STATISTICS Expand / Collapse
Author
Message
Posted 5/10/2006 4:02:15 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 3/13/2008 3:39:40 AM
Posts: 12, Visits: 2
Hi,

I have few queries realted to COLLECT STATISTICS:

1) Do we need STATISTICS for small table?

2) After how many records or percentage of changes before we should run new STATS or refresh STATS?

3) Which & how many columns are the best choice for collecting STATS?

4) Is it possible to run STATS on a portion of a table?

Thanks and Regards,
TS.
Post #4133
Posted 5/10/2006 5:05:03 AM
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 10/12/2006 2:51:00 PM
Posts: 68, Visits: 1
Hi TS,
I would answer like this to your questions:

1. when writing about small tables you are thinking about lookup tables, aren't you? if so, thinking about a 3NF db, I would collect stats on the pk of these tables. Anyway, you have to check the explain of the most common queries in order to run the best way.

2. the manual recommends recollecting stats whenever 5% - 10% of the rows have changed. If they are not too resource-consuming, I would collect them after every batch job (parhaps the most important of them)

3. you have to run explain of your queries and trying tuning it. or you can use "diagnostic helpstats on for session" command if you desire hints for the RDMBS

4. once you have collected stats on one table, you may refresh only some stats on your table, by using the "collect statistics on COLUMN " option.

Hope this helps,
Bye,
TDUser
Post #4134
Posted 5/10/2006 5:22:51 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 3/13/2008 3:39:40 AM
Posts: 12, Visits: 2
Thanks a lot!

will get back in case of any other queries.

Regards,
TS.
Post #4135
Posted 5/14/2006 2:35:27 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
This is a comment on the 4th answer

Actually you can collect statistics on a selected % of tables rows.
You may use "USING SAMPLE" qualifier for collecting statistics on % of table rows.

There are some restrictions that apply.
You may want to look up SQL Reference Guide: DDL for more information.

Vinay
Post #4163
Posted 6/19/2006 9:33:38 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 recommend collecting stats on at least on Primary Index column. In the absence of stats, we may encounter soome bad plans. At times, a larg table may be assumed smaller to a small table. This leads to a poor plan.
Post #4396
« 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 4:00pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.109. 7 queries. Compression Disabled.