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:
- Loading data that hangs at 98%
- Performance issues
- Projects that open slowly
- Windows that disappear after loading data
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:
- Log in to your Microsoft SQL Server Database as a system administrator (sa) user.
- Run the following query:
exec sp_updatestats
To gather statistics for the PROJECTS and TASKS tables:
- Log in to your Microsoft SQL Server Database as a system administrator (sa) user.
- 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:
- Log in to your Microsoft SQL Server Database as a system administrator (sa) user.
- 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