How to clear the long term stats of a sensor

I think there is good reason of using “metadata_id” as a “primary key” (I am not a DB expert - so may use incorrect words, so apologize).
The “states_meta” contains these entries:
image

Imagine that the 2nd “entity_id” belongs to the same entity (which has some “unique_id”):
– someone opened more-info for this entity;
– since the entity has “unique_id” - it is possible to change some properties (incl. “entity_id”);
– so “entity_id” was changed;
– this change was reflected in “core.entity_registry”;
– and a new “entity_id” was added into “states_meta” with SAME “metadata_id”:
image

Now the entity with NEW “entity_id” will have consistent history.
Of course there are pro & contra for this possible behaviour.