What are statistics, under what circumstances they go out
of date, how do you update them?
Answers were Sorted based on User's Feedback
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 |
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 |
What is sql injection and why is it a problem? : sql server security
How to include date and time values in sql statements?
What can be used instead of trigger?
You have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation?
What are the differences between stored procedure and view in sql server?
Why use identity in sql server?
What is acid mean in sql server?
What is single-user mode and what are the steps you should follow to start sql server in single-user mode?
What is a Join and explain its types?
What is multi-statement table-value user-defined function?
Can we use having clause without group by?
What is use of except clause? How it differs from not in clause?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)