Gathering Statistics

Statistics are an option that you can enable for your Microsoft SQL Server Database that automatically collections information about data distribution within tables and indexes, query patterns, query results, and the like. You should gather statistics so that you can optimize your interactions with your P6 EPPM database.

For example, gathering statistics can help you recognize and resolve the following issues:

For more information about enabling statistics gathering in your Microsoft SQL Server Database, refer to Introduction to the Statistics in SQL Server article in the Microsoft documentation library.

To gather statistics for all of the P6 EPPM tables:

  1. Log in to your Microsoft SQL Server Database as a system administrator (sa) user.
  2. Run the following query:

    exec sp_updatestats

To gather statistics for the PROJECTS and TASKS tables:

  1. Log in to your Microsoft SQL Server Database as a system administrator (sa) user.
  2. Run the following queries:

    update statistics project with fullscan ,all

    update statistics task with fullscan ,all

To determine the last time statistics were gathered per index and table:

  1. Log in to your Microsoft SQL Server Database as a system administrator (sa) user.
  2. Run the following query:

    SELECT OBJECT_NAME(A.object_id) AS Object_Name, A.name AS index_name, STATS_DATE(A.OBJECT_ID, index_id) AS StatsUpdated,

    DATEDIFF(d,STATS_DATE(A.OBJECT_ID, index_id),getdate()) DaysOld

    FROM sys.indexes A

    INNER JOIN sys.tables B ON A.object_id = B.object_id

    WHERE A.name IS NOT NULL

    ORDER BY DATEDIFF(d,STATS_DATE(A.OBJECT_ID, index_id),getdate()) DESC



Legal Notices | Your Privacy Rights
Copyright © 1999, 2023

Last Published Thursday, January 12, 2023