Clean up data

Retrieving records from a large table requires more time than retrieving data from a small table. Therefore, from a performance point of view and a data growth perspective, tables must be kept as small as possible. To achieve this, you can do the following:

  • Delete records.
  • Archiving: Move records to another company.
  • History logging: Copy records to another table.
Note

For more information, refer to the User's Guide for ERP LN Archiving (U9352* US).

Delete records

To improve performance and reduce database growth, deleting records is highly effective. The disadvantage of deleting records is that data is no longer available. Usually, however, not all records need to be saved.

For example, line activities are stored by warehouse. Normally, you do not need to keep these records. Therefore, after closing a warehouse order, line activities can be removed. The User's Guide for ERP LN Archiving describes several sessions you can use to delete old data. Other data such as items and business partners can be reviewed once in a while, after which you can delete the data you no longer need.

For every order and contract table a session is available to archive and delete old orders. In these sessions, you can specify several characteristics to select the orders to be removed, such as date or status. Run these sessions on a regular basis.

Archiving

If data must be available for future usage, such as analysis or review, but you no longer need the data in a live company, you can archive the data. This means the data is deleted from the live company, and moved to another company, the so-called archive company. From a performance point of view, archiving has the same effect as deleting records, because the data is no longer present in the live company. However, the data remains available in the archive company, which means the total data amount does not change. Note that at several places in LN, sessions are available for archiving. From a database growth perspective, archiving and deleting are the preferred options.

History

To keep track of the changes with respect to specific orders, and not burden the actual order tables, you can write data to history tables. When an order is created, it is copied to the history, and every update of the actual order results in a new record in the history table.

There are processes that require data to be present in the live company, such as sales and purchase statistics and reconciliation in Sales and Procurement. To unburden the transactional order tables, these processes make use of the history tables, so data can be removed from the transactional order tables at an early stage. In other places, such as in Warehousing, to keep track of a specific warehouse order you can use history logging.

Note that if you use history logging, you must archive and delete data from the history tables on a regular basis. For most data, this can be done immediately after logging. For data such as the purchase and sales orders history, the moment of deleting or archiving depends on other business processes such as reconciliation.

Conclusion

You must delete data from the live environment on a regular basis. If data is still required for future analysis, archive the data. You must only use history logging when required. Archive data as soon as possible, and delete the data from the live environment.