What is the need of collect statistics in teradata ? How does collect stats works in TD?

Collect stats is an important concept in teradata, collect stats gives parsing engine (PE) to come up with a plan with least cost for an requested query.
Collect stats defines the confidence level of PE in estimating "how many rows it is goin to access ?
how many unique values does a table have , null values etc and all this info is stored in data dictionary.
Once you submit a query in TD the parsing engine checks if the stats are aviable for the requested table , if it has collected stats earlier
PE generates a plan with "high confidence" . in absence of collect stats plan will ne with "low confidence" .
However teradata's optimizer is very robust and intelligent, even if you do not collect stats on a table,coulmn,indexes PE does an
"Dynamic Amp sampling " which means it will select a random amp and this random amp comes up with the info about the table data it has ,
based upon this PE ( knows datademographics & available system componets) estimates the workload and generates a plan.hope this info helps.

Post a Comment