Statistics - function description
OBS This feature requires that you have installed til base + index pack of MiracleDB

  • stats.collectStatisticsInfo
    • This is the stored procedure that checks the statistics on your database, and adds elements to the base.scheduler table, which then will be ready to be updated.


Examples of use:

For automatic statistics maintenance, you need to schedule these two via a SQL Server Agent job:

EXEC stats.CollectStatisticsInfo
EXEC base.ExecuteTasks @ScheduleType = 'UPDATE STATISTICS'

This scans all statistics on all tables in all databases on the selected server:

EXEC stats.CollectStatisticsInfo 

This scans all statistics in the database with database_Id = 5:

EXEC stats.CollectStatisticsInfo @Database_id = 5 

This scans all statistics in all databases with the FULLScan option:

EXEC stats.CollectStatisticsInfo @DoFullScan = 1

 


Here is a complete list of parameters for the stored procedure, with their default values

@database_id int = 0
@object_id int = 0
@index_id int = 0
@UpdateStatsPercentage int = 10
@DoFullScan smallint = 1
@SamplePercentage int = 25

Last edited Nov 15, 2010 at 4:35 PM by Sjang, version 8

Comments

No comments yet.