Overview
Over time, the Boring database may grow significantly depending on the size of your environment, the number of events generated, and the amount of historical data retained.
This article explains how to identify which database tables are consuming the most storage and how to remove older Live Monitoring events to free up database space.
Note: The default name of the Boring database is BoringBase. However, a different database name may have been specified during installation. Throughout this article, ensure you select the appropriate Boring database for your environment.
Transaction Log Issues: If you are experiencing an issue with the database transaction log being full, please refer to the following article instead:
Resolving the Transaction Log Full Error for BoringBase
Step 1: Identify Which Tables Are Consuming the Most Storage
Before deleting any records, identify which tables in the Boring database are consuming the most storage.
- Open SQL Server Management Studio (SSMS) and connect to the SQL Server hosting the Boring database.
- In Object Explorer, expand Databases.
- Locate the Boring database (default: BoringBase).
- Right-click the Boring database.
- Navigate to Reports → Standard Reports → Disk Usage by Top Tables.
- Wait for the report to finish loading.

Navigate to Reports → Standard Reports → Disk Usage by Top Tables in SQL Server Management Studio to generate a database storage utilization report.
Step 2: Review the Disk Usage Report
The report displays the storage utilization of each table in the Boring database, including:
- # Records: Number of records in the table.
- Reserved (KB): Total storage allocated to the table.
- Data (KB): Storage consumed by the table's data.
- Indexes (KB): Storage consumed by indexes.
- Unused (KB): Allocated but unused storage.
Sort the report by the Reserved (KB) column in descending order to identify the largest tables.
In the example below, the LiveMonitoring.Event table contains over 19 million records and accounts for approximately 8.75 GiB of database storage.

Example of the Disk Usage by Top Tables report showing LiveMonitoring.Event as the largest table in the Boring database.
If the LiveMonitoring.Event table is consuming a significant amount of storage, proceed to Step 3.
If other tables are consuming a significant amount of storage, please export the report or take a screenshot of the complete results and send it to Boring Support for review before deleting any records.
Step 3: Delete Older Live Monitoring Events
The following SQL script deletes records from the LiveMonitoring.Event table that are older than one year, in batches of 10,000 records.
Deleting records in smaller batches helps reduce the impact on SQL Server compared to deleting all records in a single transaction.
Important – Before proceeding:
- Ensure you have a recent backup of the Boring database.
- Perform this operation during an approved maintenance window.
- Ensure sufficient transaction log space is available.
- Verify that the historical event data is no longer required. Deleted records will no longer be available in Boring.
Instructions
- Open SQL Server Management Studio (SSMS).
- Right-click the Boring database and select New Query.
- Verify that the correct Boring database is selected in the database dropdown at the top of the query window.
- Copy and paste the SQL script below.
- Click Execute in the toolbar.
- Monitor the progress in the Messages tab.
SQL Script
SET NOCOUNT ON;
SET XACT_ABORT ON;
DECLARE
@BatchSize int = 10000,
@RowsAffected int,
@TotalDeleted bigint = 0,
@TotalToDelete bigint,
@CutoffDate datetime2(0) = DATEADD(YEAR, -1, GETUTCDATE()),
@StartTime datetime2(0) = SYSDATETIME(),
@ElapsedSeconds int;
PRINT '----- Delete from LiveMonitoring.Event started -----';
PRINT CONCAT('Cutoff date: ', CONVERT(varchar(30), @CutoffDate, 126));
PRINT CONCAT('Batch size: ', @BatchSize);
SELECT
@TotalToDelete = COUNT_BIG(*)
FROM LiveMonitoring.[Event] WITH (NOLOCK)
WHERE [Timestamp] < @CutoffDate;
PRINT CONCAT('Planned rows to delete (approx): ', @TotalToDelete);
WHILE 1 = 1
BEGIN
BEGIN TRAN;
DELETE TOP (@BatchSize)
FROM LiveMonitoring.[Event]
WHERE [Timestamp] < @CutoffDate;
SET @RowsAffected = @@ROWCOUNT;
SET @TotalDeleted += @RowsAffected;
COMMIT TRAN;
IF @RowsAffected = 0
BEGIN
BREAK;
END;
SET @ElapsedSeconds =
DATEDIFF(SECOND, @StartTime, SYSDATETIME());
DECLARE
@Remaining bigint,
@Msg nvarchar(400);
IF @TotalToDelete IS NULL
BEGIN
SET @Remaining = NULL;
END
ELSE
BEGIN
SET @Remaining = @TotalToDelete - @TotalDeleted;
END;
SET @Msg = CONCAT(
'Batch deleted: ', @RowsAffected,
' rows | Total deleted: ', @TotalDeleted,
' | Planned remaining: ',
COALESCE(CONVERT(varchar(30), @Remaining), 'n/a'),
' | Elapsed: ', @ElapsedSeconds, ' sec'
);
RAISERROR(@Msg, 0, 1) WITH NOWAIT;
-- Optional throttle
--WAITFOR DELAY '00:00:01';
END;
SET @ElapsedSeconds =
DATEDIFF(SECOND, @StartTime, SYSDATETIME());
PRINT '----- Delete from LiveMonitoring.Event finished -----';
PRINT CONCAT('Total deleted: ', @TotalDeleted);
PRINT CONCAT('Elapsed seconds: ', @ElapsedSeconds);Expected Output
While the script is running, the Messages tab in SQL Server Management Studio will display the following information:
- Cutoff date for records being deleted.
- Batch size.
- Estimated number of records to be deleted.
- Number of records deleted in each batch.
- Total number of records deleted.
- Estimated number of records remaining.
- Total elapsed time.

Example of a successfully completed cleanup operation, showing the cutoff date, batch size, number of deleted records, and total execution time. This example uses a smaller batch size for demonstration purposes.
Depending on the number of records and SQL Server performance, this operation may take a significant amount of time to complete.
Step 4: Run the Boring Database Migration
Once the database cleanup has completed successfully, manually run the Boring Database Migration to ensure any pending database migrations are applied.
Follow the instructions in the following KB article:
Running the Boring Database Migration Manually
Ensure the migration completes successfully before proceeding to the next step.
Additional Notes
Adjusting the Retention Period
By default, the script retains the most recent year of Live Monitoring events. If you need to retain a shorter period of historical data, you can modify the @CutoffDate parameter.
For example, to retain only the last six months:
@CutoffDate datetime2(0) = DATEADD(MONTH, -6, GETUTCDATE()),
Adjusting the Batch Size
The default batch size is 10,000 records. If the cleanup operation is causing SQL Server performance issues, you can reduce the batch size to 1,000 records:
@BatchSize int = 1000,
You can also enable the optional one-second delay between batches by uncommenting the WAITFOR DELAY line in the script.
If the Issue Persists
If the Boring database continues to experience storage-related issues, please contact Boring Support and provide an updated Disk Usage by Top Tables report for further investigation.
Comments
0 comments
Please sign in to leave a comment.