Skip to content

Commit

Permalink
pushed data cleanup outside the size limit loop
Browse files Browse the repository at this point in the history
  • Loading branch information
sql-williamd committed Mar 6, 2018
1 parent 3251a06 commit 5f17f55
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions setup/install_gather_statistics.sql
Expand Up @@ -570,23 +570,6 @@ AS
WHERE ( [waiting_tasks_count] = 0
AND [interval_id] = ( SELECT MAX( [interval_id] ) - 1 FROM [oqs].[intervals] ));

-- Run regular OQS store cleanup if activated
IF @data_cleanup_active = 1
BEGIN
IF @logmode = 1
BEGIN
INSERT INTO [oqs].[activity_log] ( [log_run_id],
[log_timestamp],
[log_message] )
VALUES ( @log_logrunid, GETDATE(), 'OpenQueryStore data cleanup process executed.' );
END;

-- Tidy up time!
EXEC [oqs].[data_cleanup] @data_cleanup_threshold = @data_cleanup_threshold,
@data_cleanup_throttle = @data_cleanup_throttle;

END;

-- And we are done!
IF @logmode = 1
BEGIN
Expand Down Expand Up @@ -618,4 +601,21 @@ AS
[log_message] )
VALUES ( @log_logrunid, GETDATE(), 'OpenQueryStore data capture not activated. Collection skipped' );
END;

-- Run regular OQS store cleanup if activated
IF @data_cleanup_active = 1
BEGIN
IF @logmode = 1
BEGIN
INSERT INTO [oqs].[activity_log] ( [log_run_id],
[log_timestamp],
[log_message] )
VALUES ( @log_logrunid, GETDATE(), 'OpenQueryStore data cleanup process executed.' );
END;

-- Tidy up time!
EXEC [oqs].[data_cleanup] @data_cleanup_threshold = @data_cleanup_threshold,
@data_cleanup_throttle = @data_cleanup_throttle;

END;
END;

0 comments on commit 5f17f55

Please sign in to comment.