The App Usage Service has a default retention period of 365 days. At the default setting, the size of the database can become large enough to have a detrimental impact of the performance of the Tanzu Application Service mysql database. One can observe the impact of App Service Usage queries in the slow query log on the mysql server.
The safest way to reduce the app usage service database size is to lower the Usage Service Data Retention Period in the Tanzu Application Service (TAS) tile, Advanced Features tab. The default value is 365 days, the minimum value is 93 days. Retention period is known as "Usage Service Cutoff Age" in older TAS versions. After setting and saving the desired value, Apply Changes to the TAS tile.
before
use app_usage_service;
mysql> select count(*) from daily_app_config_usages;
+----------+
| count(*) |
+----------+
| 219486 |
+----------+
1 row in set (0.02 sec)
after
mysql> select count(*) from daily_app_config_usages;
+----------+
| count(*) |
+----------+
| 55997 |
+----------+
1 row in set (0.01 sec)