What are statistics, under what circumstances they go out
of date, how do you update them?

Answers were Sorted based on User's Feedback



What are statistics, under what circumstances they go out of date, how do you update them?..

Answer / swapna

Statistics determine the selectivity of the indexes. If an
indexed column has unique values then the selectivity of
that index is more, as opposed to an index with non-unique
values. Query optimizer uses these indexes in determining
whether 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 the
index
2) If a large amount of data in an indexed column has been
added, changed, or removed (that is, if the distribution of
key values has changed), or the table has been truncated
using the TRUNCATE TABLE statement and then repopulated
3) Database is upgraded from a previous version

Is This Answer Correct ?    9 Yes 0 No

What are statistics, under what circumstances they go out of date, how do you update them?..

Answer / koti

Statistics determine the selectivity of the indexes. If an
indexed column has unique values then the selectivity of
that index is more . Query optimizer uses these statistics
in determining whether to choose an index or not while
executing a query.

To update statistics there is command :

update_statistics

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More SQL Server Interview Questions

Can we rollback records deleted by a truncate statement?

3 Answers   CarrizalSoft Technologies, United Healthcare,


Explain comment on transactions?

0 Answers  


what is the cursor life span?

5 Answers   Evalueserve, HG,


What is the difference between deallocate cursor and close cursor?

0 Answers  


How to locate and take substrings with charindex() and substring() functions?

0 Answers  






wat will be the sql query to extract only last 3 records from table supose table hving thousands for records

19 Answers  


What are the different types of columns types constraints in the sql server?

0 Answers  


How to delete a login name in ms sql server?

0 Answers  


What does ss stand for sexually?

0 Answers  


Explain log shipping and mention its advantages.

0 Answers  


What is the maximum length of an alert name?

0 Answers  


Why are views required in the sql server or in any other database?

0 Answers  


Categories