Run the Database Statistics

Database statistics show the distribution of the data in the database, and how the data is stored. When a database executes a query, it uses an optimizer to determine the best path to access the data. The optimizer relies on execution plans that specify the order in which the database accesses the tables and the exact steps used to pull the data. The database bases the creation of the execution plans on the database statistics.

As the data grows and changes, the statistics quickly become outdated and no longer reflect the true condition of the database. As a result, the execution plans no longer apply and the optimizer makes poor decisions when processing queries. You should run statistics regularly to ensure the maximum performance of your database and, therefore, your mart. We recommend that you run the database statistics nightly, and create an automated batch job to simplify the process.