In our Postgres DB I've noticed there are orphaned metrics and metrics data at 2023.2.
There are nearly 500k orphaned records in the metrics table where the component has been deleted, mostly for services but a handful of storage ones too. There are just over 8k valid metrics.
Also, there are over 13M records in the metrics_data table where the metric has been deleted. This is about 1.6% of the entire table.
It would appear that the upstream deletes haven't cascaded at some AGM version. Perhaps this was caused by bugs that have subsequently been fixed so no further orphans are created, but the existing orphans haven't been cleaned up.
I haven't checked anywhere else in the DB if there are other examples of orphaning.
Is this a known issue and will future versions clean this up?