Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 1.36 KB

sqlserver_statistics.rst

File metadata and controls

21 lines (14 loc) · 1.36 KB

SQL Server Statistics

The maintenance of statistics falls outside the scope of Firely Server.

Normally SQL Server will update and maintain the statistics automatically. But when the database becomes large this process might happen too infrequently. There is no magic bullet for updating statistics, so you are advised to experiment and test what works best for your setup.

Consider updating statistics for the following conditions1:

  • Query execution times are slow.
  • Insert operations occur on ascending or descending key columns.
  • After maintenance operations.

To manually update statistics there are two options23:

  • A stored procedure sp_updatestats: this runs UPDATE STATISTICS against all user-defined and internal tables in the current database.
  • A SQL statement against a single table (here we use the Entry table) UPDATE STATISTICS [vonk].[entry];

  1. SQL Server Statistic docs

  2. Store procedure sp_updatestats

  3. Update statistics single table