
|
! Important: This article contains steps on how to reduce the capacity consumption of AsyncOperationBase table, which involve deleting custom data. Following deletion, these records will not be available anymore. Before proceeding with deleting any data in this table, please make sure to review your customizations, your workflows and plugins running on delete operations, and review cascade delete behaviors, in order to make sure that no data gets unintendedly deleted in the process. These actions should be tested first in a sandbox environment before proceeding with the final delete operation. |
What is AsyncOperationBase?
The first information we should be aware is that AsyncOperation table contains the data related to system jobs & events for an Environment that are going to run in an Asynchronous way (meaning, not immediately). We have an interesting, detailed information on https://learn.microsoft.com/en-us/power-platform/admin/cleanup-asyncoperationbase-table This official documentation talks about Out of the box Bulk deletion jobs (Removing completed workflow system jobs older than 30 days).
Also, is important to understand that system jobs can have three status:
As stated on documentation, jobs that are running or pending, shouldn't be automatically cleaned. Therefore, a manual action to cancel should be triggered.
From https://learn.microsoft.com/en-us/power-apps/developer/data-platform/reference/entities/asyncoperation there are a couple interesting fields: DataBlobId and DataBlobIdName. This is due to SystemJobs being records on the table (thus, consuming Database Capacity), but also some might have files associated required for processing (a workflow with with a long list of condition stored in an XML File for example). These files will occupy File Storage capacity, and shows in our reports:
How To reduce AsyncOperation?
As from the previous documentation:
One important thing we can check is: How many jobs we have that fulfill a particular condition? For example: How many System Jobs I currently have consuming File storage? By connecting to the Database in a ReadOnly mode as documented on https://docs.microsoft.com/en-us/powerapps/developer/data-platform/dataverse-sql-query we can query the database and look for a specific set of conditions:
This query will show all SystemJobs with their type, their name, a friendly message they might have associated as well as the number of times it exists on the table (depending on the execution attempts, status, etc). Note the condition added: Where datablobid IS NOT NULL. This means that this will show records where there's a DataBlobID, meaning, there's a file associated to the system job. As a result, this query shows all SystemJobs consuming File Capacity:
With this information, we can then go to the Environment and search for those specific jobs, check if their status is Waiting/Waiting for resources, verify if there's any error associated to them, and proceed to remediate the possible failure, or Cancel the job (so it can be picked by our custom Bulk Deletion Job)
Hope it helps!
*This post is locked for comments
I have the same question (0)