What are statistics, under what circumstances do they go out of date, how do you update them?
Statistics determine the selectivity of the indexes. If anindexed column has unique values then the selectivity ofthat index is more, as opposed to an index with non-uniquevalues. Query optimizer uses these indexes in determiningwhether to choose an index or not while executing a query.
Some situations under which you should update statistics:1) If there is significant change in the key values in theindex2) If a large amount of data in an indexed column has beenadded, changed, or removed (that is, if the distribution of
key values has changed), or the table has been truncatedusing the TRUNCATE TABLE statement and then repopulated3) Database is upgraded from a previous version