The order analysis workspace is an overview where the user can access and analyze past orders. All data about orders are kept in the data series found in the order analysis. Because data about orders is kept in the order analysis data series there is no need to keep old order data in the order grid (order tables), which can with time make the order grid slow in performance.
Therefore, with the Order Cleanup configurations it is possible to either delete or archive orders that have not been updated for a certain amount of time.
The procedure [dbo].[housekeeping_order_cleanup] handles the order cleanup.
In [core].[setting], you define for how many days the customer would like to keep orders in the order-grid workspace. Additionally, you define whether the old orders will be deleted from the order tables or archived, see detailed description below how this works.
So, the two parameters set in [core].[setting] are:
ordercleanup_retentiondays:
This parameter tells for how many days to keep the data before archiving or deleting it. Can be set to minimum 8 days.
The default value is 365 days.
ordercleanup_type:
Possible values are “archive” or “delete”.
The default value chosen is “archive”.
Select delete: Orders and all data connected to them that were updated X retention days ago will be deleted from the following tables:
Note, although the data is deleted from those tables, it is [partially] available in the order analysis table [dbo].[item_group_order_info].
Select archive: Orders that were updated X retention days ago will be archived to special archive tables that store the archived data. Those tables belong to the [archive] schema and will be automatically created for you.
The archived data is moved from and inserted to the following tables:
The data is then deleted from the [dbo] tables after it has been inserted to the archived tables.
So, we are deleting old orders from those 3 tables, making the order grid more manageable, but keeping the data in the archived tables if they need to be accessed later.
The Order Analysis workspace has the following data series:
The dataseries are retrieved from the table [dbo].[item_group_order_info].