Reducing Data Stored in LS Central SaaS Database
In this article
Monitoring and Managing Data Storage in Business Central Online
Other possible improvements that should be considered (if applicable)
Monitoring and Managing Data Storage in Business Central Online
In Business Central Online, administrators have built-in tools to analyze how database storage is used across environments and to perform standard data maintenance tasks without requiring custom development.
Analyzing Storage Usage
Tenant administrators can begin by reviewing storage consumption through the Admin Center. This provides an overview of storage usage per environment. From there, it's possible to drill down further and view the storage distribution across individual tables.
Selecting the option to view table details opens the Table Information (Page 8700). This page shows key metrics for each table, including:
- Number of records
- Average record size
- Total table size
- Index size
- Compression method (if applicable)
While this page is useful for analysis, it does not allow direct data maintenance actions.
Data Administration Page
Starting with version 18.2, Business Central introduced the Data Administration page, which provides a more comprehensive and actionable overview of database usage.
After refreshing the data, the page presents:
Table Insights
A list of tables with detailed metrics such as:
- Number of records
- Total data size
- Size growth over the last 30 days
- Percentage growth over the last 30 days
This information helps identify which tables are growing rapidly and which remain relatively unchanged. Tables with little or no growth may be suitable candidates for optimization techniques such as data compression.
Company Storage Overview
A breakdown of storage consumption by company within the environment, along with the total environment size. This helps pinpoint which companies contribute most to overall storage usage.
Data Cleanup Capabilities
The Data Administration page also provides built-in actions for cleaning up data. These actions are available without customization and cover several common data areas, including:
- Change Log Entries
- Document Archives
- Posted (invoiced) documents
- Marketing-related data
- Cost accounting entries
- Physical inventory ledger entries
Each cleanup operation runs through a report interface where filters can be applied to define exactly which data should be removed.
More information here: Microsoft Learn - Manage storage by deleting documents or compressing data - Delete documents
LSC Delete Logs
LS Central includes a dedicated codeunit - LSC Delete Logs - designed to clean up operational and log data that accumulates over time across several areas of the solution. This codeunit can be scheduled as a job queue entry, making it easy to incorporate into a regular maintenance routine.
The purpose of LSC Delete Logs is to remove data that is transient by nature: scheduler and replication logs, action queue records, replenishment calculation data, discount performance entries, forecast data, and POS logs. Left unchecked, these tables can grow significantly and contribute to unnecessary database bloat. In addition, the codeunit delegates cleanup for printed labels and finished batch posting jobs to dedicated utility codeunits within those respective areas.
The following tables are cleaned up by LSC Delete Logs, grouped by area:
Action Tables
- LSC Actions
- LSC Preaction
- LSC Delete Preaction
- LSC Commerce Action
Scheduler / Replication Logs
- LSC Scheduler Log
- LSC Preaction Log
Replenishment
- LSC Replen. Out of Stock Log
- LSC Replen. Sales Hist. Adj.
- LSC Replen. Planned Sales Dem.
- LSC Replen. Planned Event
- LSC Release Calendar Log Entry
- LSC Release Cal. Log Detail
Discount Performance
- LSC Actual Disc. Performance
- LSC Planned Disc. Performance
Retail Forecast
- LSC Forecast Entry
- LSC Forecast Dimension Entry
Actionable Insights (ACI)
- LSC ACI Signal
- LSC ACI Alert
- LSC ACI Alert Detail
- LSC ACI Notification
POS
- LSC POS Log
Others
- LSC Shelf Label
- LSC Shelf Label Batch
- LSC Shelf Label Spool
- LSC Item Label
Retention Policies for LS Central Tables
Business Central's Retention Policies feature allows administrators to define rules for automatically deleting records from specific tables after a configurable retention period. LS Central extends this feature by registering a set of its own tables as candidates for retention policies.
While some of these tables are also covered by the Transaction Archiving feature, it is worth considering whether archiving is actually necessary for all of them. Many of these tables contain operational or diagnostic data - such as logs, print buffers, and temporary calculation data - that has limited long-term value and does not need to be preserved in an archive. For this type of data, a straightforward retention policy that deletes records older than a defined period is a simpler and more appropriate solution.
The following LS Central tables can be included in retention policies:
- LSC Replen. Planned Sales Dem.
- LSC Replen. Sales Hist. Adj.
- LSC WS Request Log
- LSC Web Applic. Restore Data
- LSC POS Debug Log
- LSC POS Print Buffer
- LSC POS Print Header
- LSC POS Print Line
- LSC POS Card Print Header
- LSC POS Card Print Text
- LSC Price History
- LSC Adj. Item Ledgers for RBO
- LSC Wish List Header
Data Compression Options
To further optimize database size, date-based compression features are available. These include:
- Compress Ledger Entries: Summarizes older entries over a defined period while preserving essential information
- Delete Empty Registers: Removes unused register records
These operations also use standard processing reports that allow filtering before execution.
Note: You can only compress data more than five years old. If you want to compress data less than five years old, you need to use the OnSetMinimumNumberOfYearsToKeep event in the Date Compression codeunit to set the threshold.
More information here: Microsoft Learn - Manage storage by deleting documents or compressing data - Compress data with date compression
Data Archiving Capabilities
Transaction Archiving in LS Centrall helps keep transaction-related tables lean through two complementary tiers. The first tier moves older posted transaction records from the primary transactional tables into dedicated archive tables, still within the LS Central/Business Central database. Because archive tables carry fewer indexes, this reduces both database size and the load on core tables, resulting in faster searches, calculations, and operational processes.
The second tier takes archiving further by exporting records from the archive tables to an external Azure Storage Account, where each transaction is saved as a JSON file. Once exported, the records can be removed from the archive tables entirely, delivering a substantial reduction in overall database size. Since Azure Storage is considerably cheaper than additional Business Central database capacity, this also makes long-term data retention more cost-efficient.
More information here: Online Help - Transaction Archiving
Data Administration Guide
A guided experience is available to help configure and manage data-related processes. This guided setup assists administrators in:
- Defining data retention policies
- Identifying and reviewing unused companies
- Applying date compression to selected ledger entry tables
Over time, ledger tables can significantly increase database size. Using compression helps reduce this growth while maintaining meaningful historical data.
Table size analysis
The following list is based on an analysis of table sizes across several large Business Central and LS Central environments. These are the tables most commonly found among the top space consumers.
Of these tables, two groups can be identified from a data maintenance perspective:
- Standard Business Central tables (G/L Entry through Change Log Entry): The built-in BC Data Administration features and date compression tools give tenant administrators direct ways to reduce the size of these tables without custom development.
- LS Central tables (tables prefixed with LSC): Dedicated cleanup and maintenance features within LS Central allow administrators to manage the data in these tables. These are described in the LS Central options section.
Most common largest tables
- G/L Entry
- Value Entry
- Item Ledger Entry
- G/L - Item Ledger Relation
- Item Application Entry
- Cust. Ledger Entry
- Detailed Cust. Ledg. Entry
- Warehouse Entry
- Change Log Entry
- LSC Transaction Header
- LSC Trans. Sales Entry
- LSC Trans. Infocode Entry
- LSC Trans. Sales Entry Status
- LSC Trans. Payment Entry
- LSC POS Card Print Text
- LSC Member Contact
- LSC Membership Card
- LSC Replen. Planned Sales Dem.
- LSC Replen. Calc. Log Lines V2
Other possible improvements that should be considered (if applicable)
Aggregated Inventory
Using the Aggregated Inventory solution:
- Slows down growth of Item Ledger and Value Entry tables
- Compresses ILE and VLE records to AGRI entries
- AGRI entries can be compressed and truncated
That can mean about 65% to 81% data reduction.
Duration improvements:
- Statement Posting Cost - 30%
- Item Adjustment Cost - 97%
- Item Posting Cost - 34%
Moving from pre-actions to timestamps
Replicating data from Head Office to store companies is a common requirement in LS Central deployments. Historically, this was handled through Preactions — a mechanism that tracks and replicates only the changes (deltas) between companies. Over time, however, Preaction tables can accumulate a large number of records and become a significant contributor to database size.
Starting with LS Central v26, Timestamps are used for change tracking instead. This approach handles deltas more efficiently, substantially reducing the number of records held in the Preaction tables and leading to a significant decrease in their overall size.
More information here: Preactions - Timestamp Change Tracking
Inactivate Indexes (New in BC28)
In Business Central v28, Enhanced Index Management allows administrators to toggle database indexes on or off per company directly from the user interface. This optimization improves performance by speeding up write operations and lowering storage consumption.
More information here: Manage database index usage